I am having trouble with FileSource with the Seek operator.  Without
the Decryptor.Seek(0) operation, the decryption works.  Any Idea?

    CryptoPP::CTR_Mode<CryptoPP::AES>::Decryption
        Decryptor( key, sizeof(key), iv );

    // Recovered Text Sink
    std::string RecoveredText;

        Decryptor.Seek(0);
        CryptoPP::StreamTransformationFilter *G = new
CryptoPP::StreamTransformationFilter(Decryptor,new
CryptoPP::StringSink( RecoveredText ));
    CryptoPP::FileSource F( "CipherText", false
    ); // StringSink
    // Debug
        F.Attach(G);
        F.Pump();
    std::cout << "Recovered Text:" << std::endl;
    std::cout << "  '" << RecoveredText << "'" << std::endl;
    std::cout << std::endl;

MT

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to