Lidia Fernández wrote:

But....whe i type the command 'openssl enc -a -aes128 -in file.txt -out
file.enc -pass pass:1234567'
i don't specify the iv....and in the sample code there is:

unsigned char iv[] = {1,2,3,4,5,6,7,8};


EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, key, iv);


I have to do the same that the command do.
How can i do this???

As the enc man page says, when a password is used and the -iv option is not specified, the iv is generated from the password. For details you should look into the enc source (apps/enc.c, near the call of EVP_BytesToKey).
Ciao,
Richard
--
Dr. Richard W. Könning
Fujitsu Siemens Computers GmbH
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to