chuangxian li liked your message with Boxer. On 周二, 8月 06, 2013 at 06:39, Jeff Phillips wrote:I'm working on an AES encryptor program and have everything working great with stream filters performing the key file, plaintext and cipher text. I've implemented several of the AES block modes but can't find a way to output the IV and the Ciphertext using a filesource, streamfilter and a filesink. Does anyone know an easy way to generate the ciphertext file such that the output is the [IV][ENCRYPTED DATA]? I'm writing separate encrypt and decrypt programs so the IV and the cipher text needs to saved to file and read from file. Here is the existing code segment: // Create IV variable byte iv[AES::BLOCKSIZE]; FileSource pt(plaintext_file.c_str(), true, new StreamTransformationFilter(e, new HexEncoder ( new FileSink(ciphertext_file.c_str(), false /* non-binary */) ) // HexEncoder ) // StreamTransformation , binaryfile_bool); // FileSource I's love to see something like this available: FileSource pt((iv + plaintext_file.c_str()), true, new StreamTransformationFilter(e, new HexEncoder ( new FileSink(ciphertext_file.c_str(), false /* non-binary */) ) // HexEncoder ) // StreamTransformation , binaryfile_bool); // FileSource Redirectors also seem to have promise when I found a concatenate files example but I'd also need a way to separate out the IV in the decrypt program which the redirector didn't seem to have a way of doing. I love the cleaness of the streamfilters but think I need to ditch them to build the output into a string. I'm not familiar with using non-stream filters and was concerned that reading large files into a string might cause an issue, but perhaps not. Thanks Jeff -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
-- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
