On Sat, Jun 28, 2008, Razack wrote:

> I'm not sure, that this code is correct?
>
>
>
> thx for help
>
>
>
> unsigned char text[]="Hello World!";
>
> char key[]="password";
>
> char iv[]="12345678";
>
>


[snip]

>
>
> EVP_EncryptInit_ex(&ctx,EVP_aes_256_cbc(),NULL,key,iv);
>


The key for that algorithm is 256 bits and the iv 128 bits. The key and iv
values you specify are too small. This will result in it using whatever data
follows that buffer with unpredictable results.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org