Need information on AES encryption and decryption Key and IV type

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Need information on AES encryption and decryption Key and IV type

Sugumar
Hi,,

I am using Openssl for encryption and decryption.
I need some information on AES encryption and decryption key and iv type.
My doubt is when we are using a openssl in command line we need to pass key and iv as hex strings right?
and same when we are EVP calls in C/C++ programming what is the type of Key and Iv. i mean it should a hex string or raw binary values?

I saw, openssl command line interface code of openssl in that the hex strings are converted into hex values.
But in EVP calls the Key and Iv are used directly.

Reply | Threaded
Open this post in threaded view
|

Re: Need information on AES encryption and decryption Key and IV type

Michel
As Rich already answered : "The IV, key, and ciphertext are all binary
arrays of bytes."
This is not specific to AES.
Converting from or to hex (or Base64) strings is needed only to read from or
print to outside your C program.
Values passed to EVP_*() calls are expected to be raw (binary) data :
unsigned char *key, unsigned char *iv, as documented in
https://www.openssl.org/docs/manmaster/crypto/EVP_EncryptInit.html
(and do not rely on the 'bogus' key and IV values in the do_crypt()
example).
 
-----Message d'origine-----
De : openssl-users [mailto:[hidden email]] De la part de
Sugumar
Envoyé : vendredi 26 février 2016 17:30
À : [hidden email]
Objet : [openssl-users] Need information on AES encryption and decryption
Key and IV type

Hi,,

I am using Openssl for encryption and decryption.
I need some information on AES encryption and decryption key and iv type.
My doubt is when we are using a openssl in command line we need to pass key
and iv as hex strings right?
and same when we are EVP calls in C/C++ programming what is the type of Key
and Iv. i mean it should a hex string or raw binary values?

I saw, openssl command line interface code of openssl in that the hex
strings are converted into hex values.
But in EVP calls the Key and Iv are used directly.


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users