are you adjusting the dwLength (bytes to en/decrypt) parameter the same way on encryption and decryption of that last block? something like (TotalDataLEngth mod UsualBlockSize). the block buffer should be adjusted for any such change in dwLength, too.

disclaimer: i dont use CryptoAPI. this does sound familiar tho.

[EMAIL PROTECTED] wrote:

Hello,

I'm trying to use the MS CryptoAPI to encrypt/decrypt a large amount of
data. Because of the size of the data, I use a RC2 block cipher repeatedly.
Both the calls to CryptEncrypt and CryptDecrypt specify a hash, so the data
can be checked. Now the encrypting/decrypting is OK, until the last block.
When I try to decrypt the final block, CryptDecrypt returns rubbish after
having correctly decrypting all preceding blocks of data. Only with small
data, < 1 block, the decryption is OK.
Has anybody experienced this before?

Peter Laman
Senior Software Engineer
Lance ICT Group
Roermond, the Netherlands
http://www.lance.nl

----
----

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk



__________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to