1

In reference to the github project: https://github.com/majek/openssl/blob/master/demos/evp/aesgcm.c

And another StackOverflow question: Unable to set IV for aes gcm using openssl

I'm attempting to use OpenSSL to perform GCM encryption with a 128-bit IV. The default IV is 96-bits, 12 bytes. When I set this to 16-bits the value isn't updated and as a result the encrypted data and IV or not correct.

I tried verifying this using the following function which reads back a value of 12, when I was expecting it to change to 16 after setting it via the second following function:

int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL);

And help with be awesome! Thanks!

Chris

Chris
  • 11
  • 1
  • Some additional information that'll be helpful. I'm using OpenSSL version 1.0.1e dated back to Feb 2013. – Chris Apr 26 '18 at 19:46
  • I've seen functions written specifically for setting up a GCM context. Though I haven't seen an example using them. They're listed at the link shown below: http://docs.huihoo.com/doxygen/openssl/1.0.1c/gcm128_8c.html – Chris Apr 26 '18 at 19:48

0 Answers0