libgcrypt - Initialization Vector

Tod Thomas tthomas at chubb.com
Thu Apr 28 19:38:31 CEST 2005


Please correct me if this the wrong list to post this type of question to.

My understanding from reading the libgcrypt info is that the 
Initialization Vector "is a non-secret random string acting as a kind of 
salt value".

I wrote two seperate programs using libgcrypt, one to perform encryption 
and one to perform decryption.  Whan I pass a string to the encryption 
module and then pipe its output to the decryption module I get the 
correct value returned - as long as the IV is the same.

Once I change the IV in one I no longer get the correct, decrypted 
string back.  I discovered this because I decided to make my IV a truly 
random value by using the output of gcry_randomize to set it and that 
failed.

My question then is if the IV should behave as the documentation 
suggests why isn't my test working?  I suspect I have misunderstood 
something in the reading or in my implementation, just not sure what.

I'll be happy to provide more details upon request.


Thanks - Tod



More information about the Gcrypt-devel mailing list