diff --git a/lib/aes/aes.rb b/lib/aes/aes.rb index 28d6dc2..0c09c89 100644 --- a/lib/aes/aes.rb +++ b/lib/aes/aes.rb @@ -11,7 +11,7 @@ def decrypt(cipher_text, key, opts={}) # Generates a random key of the specified length in bits # Default format is :plain def key(length=256,format=:plain) - key = ::AES::AES.new("").random_key(256) + key = ::AES::AES.new("").random_key(length) case format when :base_64 Base64.encode64(key).chomp