Hi,

I have trouble setting variable key size for blowfish
cipher. The code, pasted below, used to work on 
version 0.9.8a, the behaviour changed after upgrading
to 0.9.8e. Under 0.9.8e it seems that calling
EVP_CIPHER_CTX_set_key_length has no effect. Using
EVP_CIPHER_CTX_key_length to check the key length,
both before and after setting the length, the value is
16.

Am I setting the key length incorrectly? Really
appreciate any help you can provide.

Thank you!

Alex


------
EVP_CIPHER_CTX ctx;

EVP_CIPHER_CTX_init(&ctx);

if (EVP_CipherInit_ex_(&ctx, EVP_bf_cbc(), NULL, NULL,
NULL,OPENSSL_ENCRYPTION)!=CRYPT_SUCCESS)
            return FALSE;

cout<<"before set key
length"<<EVP_CIPHER_CTX_key_length(&ctx)<<endl;

if
(EVP_CIPHER_CTX_set_key_length(&ctx,8)!=CRYPT_SUCCESS)
            return FALSE;

if (EVP_CipherInit_ex(&ctx, NULL, NULL, key,
ivec,OPENSSL_ENCRYPTION)!=CRYPT_SUCCESS)
            return FALSE;

cout<<"after set key
length"<<EVP_CIPHER_CTX_key_length(&ctx)<<endl;



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to