On Wed, Apr 15, 2009 at 08:05:55PM +0300, Atti wrote:

> I get always the same output for debug / and the "different" same each
> time for the release, if I use the same key and the same input data.

Clearly you have a constant IV with the debug library and a "random"
IV otherwise.

> I'm using the following EVP_* functions: EncryptInit(),
> EncryptUpdate(), EncryptFinal(). Using the 3DES cbc algorithm, but I
> tried the blowfish too, with the same results.

CBC requires an IV (initialization vector).


> I assume I use the
> functions correctly, because they work in debug mode.

Likely an accident, because memory initialization is more deterministic
debug more.

> I don't know what an "IV" is.

Well that's likely to be the problem. And generally each time you
encrypt a message you choose a random IV, so you should not expect
the ciphertext to be constant, but the party receiving the message
does need the IV, which can be sent as part of the ciphertext or
computed by both sides in some deterministic manner from a shared
seed.

-- 
        Viktor.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to