On Monday, June 17, 2013 12:21:44 PM UTC-4, [email protected] wrote:
>
> I have successfully built/run the sample "Crypto++ GCM Test.zip", but my 
> understanding is not enough to figure out how to prepare the 
> AuthenticatedEncryptionFilter::ChannelPut with istream & ostream
> for files. Can someone point me a the right direction?  
>
Use a FileSource (http://www.cryptopp.com/wiki/FileSource). FileSource has 
an overloaded constructor that takes an istream 
(http://www.cryptopp.com/docs/ref/class_file_source.html).

So it will look something like:

GCM< AES >::Decryption decrypter;
decrypter.SetKeyWithIV( key, sizeof(key), iv, sizeof(iv) );
...

istream& istrm = ...
string decrypted;

FileSource ifile(istrm, true, 
    new AuthenticatedDecryptionFilter(
        decrypter,
        new StringSink(decrypted),
        THROW_EXCEPTION | MAC_AT_END,
        TAG_SIZE)
 );

ifile.MessageEnd();


-- 
-- 
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.


Reply via email to