Skip to content

Commit

Permalink
Merge pull request #3 from Malet/master
Browse files Browse the repository at this point in the history
Fix bug with AES::key ignoring the length param
  • Loading branch information
chicks committed Feb 7, 2014
2 parents 43ae1ab + 3661b53 commit 12c3648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/aes/aes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12c3648

Please sign in to comment.