Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

Commit

Permalink
Convert the message to_s
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurpartap committed Jul 31, 2012
1 parent 4966d2f commit cff359c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/aescrypt.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@


module AESCrypt module AESCrypt
def self.encrypt(message, password) def self.encrypt(message, password)
Base64.encode64(self.encrypt_data(message.strip, self.key_digest(password), nil, "AES-256-CBC")) Base64.encode64(self.encrypt_data(message.to_s.strip, self.key_digest(password), nil, "AES-256-CBC"))
end end


def self.decrypt(message, password) def self.decrypt(message, password)
base64_decoded = Base64.decode64(message.strip) base64_decoded = Base64.decode64(message.to_s.strip)
self.decrypt_data(base64_decoded, self.key_digest(password), nil, "AES-256-CBC") self.decrypt_data(base64_decoded, self.key_digest(password), nil, "AES-256-CBC")
end end


Expand Down

0 comments on commit cff359c

Please sign in to comment.