Abhishek
Abhishek

Reputation: 63

How to get AES-128-GCM with Ruby 2.3.1

I am using OpenSSL 1.0.2k with Ruby 2.3.1, which supports the "aes-128-gcm", not "AES-128-GCM", algorithm. Ruby 2.4.0 supports both of them when bundled with OpenSSL 1.0.2k.

Where exactly does the difference lie between the two? Does being case-sensitive matter?

I couldn't find an answer. How do I get AES-128-GCM with Ruby 2.3.1?

Upvotes: 0

Views: 971

Answers (1)

the Tin Man
the Tin Man

Reputation: 160549

Ruby's 2.3.1 OpenSSL documentation says in "Instantiating a Cipher":

The most generic way to create a Cipher is the following

cipher = OpenSSL::Cipher.new('<name>-<key length>-<mode>')

That is, a string consisting of the hyphenated concatenation of the individual components name, key length and mode. Either all uppercase or all lowercase strings may be used, for example:

cipher = OpenSSL::Cipher.new('AES-128-CBC')

(The added emphasis is mine.)

In other words, 'AES-128-GCM' or 'aes-128-gcm' is acceptable.

Upvotes: 1

Related Questions