AES decrypted text mismatch

Werner Koch wk at gnupg.org
Wed Oct 11 17:15:38 CEST 2006


On Wed, 11 Oct 2006 14:22, Stephen A. Cochran Lists said:

> printf("plaintext len: %u\n", strlen(plaintext));
> printf("Decrypted text len: %u\n", strlen(decryptedtext));

You are using strlen for the decypted text but you didn't encypted the
trailing Nul.  Thus your printf as well as the strlen accesses
uninitialized memory and stops output only at the next Nul byte found.
This is also a bug in the original program.


Salam-Shalom,

   Werner




More information about the Gcrypt-devel mailing list