What works for me
OpenSSL::Cipher.new('aes-128-gcm')
I am not sure why you are getting an error message with your approach.
Edit:
This may be an upper / lower case problem. This may be an actual error.
The following works:
OpenSSL::Cipher::AES.new(128, :CBC)
because we find "AES-128-CBC" (all upper case) in OpenSSL::Cipher::AES.ciphers . AES.new seems to be searching for its ciphers with uppercase characters.
So the following does not work:
OpenSSL::Cipher::AES.new(128, :GCM)
because it is "aes-128-gcm" in the list of ciphers.
tessi source share