gcry_cipher_decrypt usage

Werner Koch wk at gnupg.org
Thu Apr 7 14:01:56 CEST 2011

On Thu,  7 Apr 2011 10:55, news at edrusb.is-a-geek.org said:

> Cipher used is blowfish. In this buggy situation, gcry_cipher_decrypt()

What cipher mode (CBC, CFB, CTR, ...) and depending on that what kind of
padding to you use.  How do you call gcry_cipher_open?

> The fact that clear data is located after the ciphered data is not

Sure it can't know that and will happlity decrypt this.
gcry_cipher_decrypt can's distinguish between cleartext and ciphertext.
The upper layer (i.e. the protocol) must define how this can be done.

> time, gcry_cipher_decrypt() returns an error as expected, because the

gcry_cipher_decrypt can't return an error except for cases where you you
pass an invalid data length (e.g. not a multiple of the blocklength).



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gcrypt-devel mailing list