From: Roland Schmitt Date: 2005-10-05T16:29:38+09:00 Subject: Re: [newbie] Encryption using OpenSSL Hi, ... > # your pass is what is used to encrypt/decrypt c.key = key = > Digest::SHA1.hexdigest("yourpass") > c.iv = iv = c.random_iv <-------------------------- What's IV?? > e = c.update("crypt this") ... look at http://www.cacr.math.uwaterloo.ca/hac/. Chapter 7 gives a good explanation about block ciphers like AES and the use of Ivs. In short: block ciphers like AES or DES encrpyts/decrypts data in blocks (ie. 16 bytes each block). The processing of each block depends on the result of the block processed before. So for the first data block there is no predecessor, instead a IV with the same block size is used to initialize the algoritm. To initialize the algorithm for decryption/encryption you need the same iv as for encryption/decryption. Regards, Roland