0

I'm assuming that OpenSSL is just using these functions here. page 66 is CBC

https://www.intel.com/content/dam/develop/external/us/en/documents/aes-wp-2012-09-22-v01-165683.pdf

Can I just generate a key/iv randomly and pass data off with these functions to encrypt/decrypt data? If so, how come the decrypt function is larger or even different than the encrypt? Shouldn't they be the same? I have a C program that does symmetric encryption with the EVP functions and works normally but I want to write an embedded program without OpenSSL or any other libraries. I've done this for key derivation (traditional method is MD5) and that took me a long time. This is for data specifically AES 256. Does it encrypt in 256 bytes or is it 16? Im highly confused about that.

1
  • 1
    AES256 uses a key of 256 bits to encrypt blocks of 128 bits, or 16 bytes.
    – Sjoerd
    Commented Jan 26 at 10:01

1 Answer 1

0

Generate random keys & IVs for AES-256 encryption/decryption using fixed 16-byte blocks, despite encrypt/decrypt function size differences due to internal implementation variations.

2
  • can I just use the aesni_cbc_encrypt assembly functions to encrypt/decrypt data?
    – shawnixer
    Commented Jan 26 at 4:55
  • AES-256 key is 32 bytes actually, but sometimes encoded in longer forms. (Regardless of key size) IV is 16 bytes for CBC CFB OFB, but often less for CTR, standardly 12 bytes for GCM, and less than 15 usually about 11 for CCM. Commented Jan 30 at 7:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .