Closed taka0125 closed 7 years ago
With Ruby 2.4 it now verifies the length of the key to ensure it matches the cipher.
Please change:
SymmetricEncryption.cipher = SymmetricEncryption::Cipher.new(
cipher_name: 'aes-128-cbc',
key: '1234567890ABCDEF1234567890ABCDEF',
iv: '1234567890ABCDEF',
encoding: :base64strict
)
Truncating the key to:
SymmetricEncryption.cipher = SymmetricEncryption::Cipher.new(
cipher_name: 'aes-128-cbc',
key: '1234567890ABCDEF',
iv: '1234567890ABCDEF',
encoding: :base64strict
)
Prior to Ruby 2.4 it just truncated the key when it was too long.
The documentation examples use a key that is too long and will be fixed to use the correct length, per the example above.
This Sample not work with ruby 2.4.
Code is here.
https://github.com/taka0125/symmetric-encryption-ruby2.4