When my program executes the line:
stfDecryptor.Put( reinterpret_cast<const unsigned
char*>( ciphertext.c_str() ), ciphertext.size() );
It exits out, without so much as an exception (as far as I can see).
With visual studio output:
The thread 'Win32 Thread' (0x13c8) has exited with code -1073740777
(0xc0000417).
The thread 'Win32 Thread' (0x19ec) has exited with code -1073740777
(0xc0000417).
The thread 'Win32 Thread' (0xdec) has exited with code -1073740777
(0xc0000417).
The thread 'Win32 Thread' (0x1874) has exited with code -1073740777
(0xc0000417).
The thread 'Win32 Thread' (0x14a4) has exited with code -1073740777
(0xc0000417).
The program '[6984] Program.exe: Native' has exited with code
-1073740777 (0xc0000417).
Google tells me that code -1073740777 (0xc0000417) means that an
invalid parameter has been passed to a WinAPI function.
Now, this code worked fine in VC++ 6.0 with an older Crypt++ library.
We moved all the code over to Visual Studio 2008, and we're now using
the 5.6
.0 code. We've tried it on both WinXP and Win7, same behavior.
After a lot of playing around with it, I've found that the problem
only happens when ciphertext.size() >= 32, which is always true in my
program.
Here's the full code:
byte key[ CryptoPP::AES::MAX_KEYLENGTH ],
iv[ CryptoPP::AES::BLOCKSIZE ];
memset( key, 0x0B, CryptoPP::AES::MAX_KEYLENGTH ); //Set the Key to
all 0x0B
memset( iv, 0x00, CryptoPP::AES::BLOCKSIZE ); //Set iv to all 0x00
CryptoPP::AES::Decryption aesDecryption(key,
CryptoPP::AES::DEFAULT_KEYLENGTH);
i = CryptoPP::AES::DEFAULT_KEYLENGTH;
i = CryptoPP::AES::MAX_KEYLENGTH;
CryptoPP::CBC_Mode_ExternalCipher::Decryption
cbcDecryption( aesDecryption, iv );
try{ //Stream cipher decryption
CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption,
new CryptoPP::StringSink( decryptedtext ) );
stfDecryptor.Put( reinterpret_cast<const unsigned
char*>( ciphertext.c_str() ), ciphertext.size() );
stfDecryptor.MessageEnd();
}
catch(CryptoPP::Exception &e){
m_strError.Format("Decryption Failed. CrpPP: %s",
e.GetWhat().c_str());
m_strPlain = "Error";
return DECRYPTION_FAILED;
}
--
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.