Skip to content

Commit

Permalink
use lower case cipher types
Browse files Browse the repository at this point in the history
  • Loading branch information
doersf committed Jun 6, 2021
1 parent 26dd225 commit 5aea0e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/block_io/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def self.decrypt(encrypted_data, b64_enc_key, iv = nil, cipher_type = "AES-256-E
response = nil

begin
aes = OpenSSL::Cipher.new(cipher_type)
aes = OpenSSL::Cipher.new(cipher_type.downcase)
aes.decrypt
aes.key = b64_enc_key.unpack("m0")[0]
aes.iv = [iv].pack("H*") unless iv.nil?
Expand All @@ -270,7 +270,7 @@ def self.decrypt(encrypted_data, b64_enc_key, iv = nil, cipher_type = "AES-256-E

# Encrypts a block of data given an encryption key
def self.encrypt(data, b64_enc_key, iv = nil, cipher_type = "AES-256-ECB", auth_data = nil)
aes = OpenSSL::Cipher.new(cipher_type)
aes = OpenSSL::Cipher.new(cipher_type.downcase)
aes.encrypt
aes.key = b64_enc_key.unpack("m0")[0]
aes.iv = [iv].pack("H*") unless iv.nil?
Expand Down

0 comments on commit 5aea0e2

Please sign in to comment.