On Wednesday, July 10, 2013 6:08:06 PM UTC-4, Steven wrote:
>
> I'm using df.put(...  and df.get(...  on large files, even though the file 
> is 
> successfully decrypted, I get no exceptions to tell me why authentication 
> is 
> failing. Is there an alternative method to verify authentication when not 
> using Channels?   
>
You have to attach an ArraySink, use PUT_RESULT, and finally call 
MessageEnd(). Upon receiving MessageEnd(), the filter will put the result 
of the authentication in the ArraySink. Something like:


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

    bool result = false;
    AuthenticatedDecryptionFilter df( decrypter,
         new ArraySink(&result, sizeof(result)),
         PUT_MESSAGE | MAC_AT_END );

    if(result == false)
        throw "Authentication failed";

General reading is available at 
http://www.cryptopp.com/wiki/Authenticated_Encryption and 
http://www.cryptopp.com/wiki/AuthenticatedEncryptionFilter. If you know the 
mode you want to use, then there's more detailed write ups at 
http://www.cryptopp.com/wiki/Eax, http://www.cryptopp.com/wiki/Ccm, and 
http://www.cryptopp.com/wiki/Gcm.

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.


Reply via email to