gcry_cipher_decrypt not functioning

Brad Hards bradh at frogmouth.net
Wed Apr 5 11:48:35 CEST 2006


On Wednesday 05 April 2006 12:04 pm, D. Hazelton wrote:
> >From watching the process in gdb it is certain that the decryption never
>
> happens. I have tried a version where I was creating a temporary buffer for
> the output, and even with that step the input stream matched the output
> stream from the function.
It would help if you could tell us what is each gcry_* function returning.

>   rval = gcry_cipher_open( &hand, algo, 0, 0 );
This looks wrong. What mode are you trying to use? 0 => GCRY_CIPHER_MODE_NONE, 
which isn't good...

You aren't setting an IV either. That is OK, as long as you are using ECB. 
However it looks like you are doing a lot of data, and ECB is a bad choice in 
this case. I like CFB (to avoid padding), but it obviously has to match 
whatever you are using to encrypt.

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/attachments/20060405/60d5ac15/attachment.pgp


More information about the Gcrypt-devel mailing list