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???
Leif Thuresson escribió:
Check the EVP_EncryptInit man page. There are some code samples at the
end of the page
http://www.openssl.org/docs/crypto/EVP_EncryptInit.html#
Just replace the cryptos in the sample code with AES128
and adjust the key length and iv length.
You can get the key length and iv length from the EVP interface.
EVP_CIPHER_key_length(EVP_get_cipherbyname("AES128"))
EVP_CIPHER_iv_length(EVP_get_cipherbyname("AES128"))
Good luck!
/leif
Lidia Fernández wrote:
Hello all!
I have to use aes128 encryption into my program to encrypt a file
with a password.
To do test, i use a "openssl enc -a -aes128 -in file.txt -out
file.enc -pass pass:12345678" command.
Now i have to find the code into openssl that does this function.
I 'm seeing in enc.c class, but it's a bit difficult because there
are a lot of code!
Somebody has do this sometimes??
Are there some utility for use aes128 into another code more easy??
PD: Sorry for my English...i know that is not good
--
*******************************************************************
LIDIA FERNANDEZ CARPES
Departamento de Ingenieria de la Informacion y las Comunicaciones
Facultad de Informatica
Universidad de Murcia. Campus de Espinardo
30080 Murcia (SPAIN)
Tel.: +34 968 364644
Fax: +34 968 364151
email: [EMAIL PROTECTED]
*******************************************************************
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]