Skip to content
Browse files

Convert the message to_s

  • Loading branch information...
1 parent 4966d2f commit cff359cce158387ba2be76fdb9e5b34e909af4c1 @Gurpartap committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/aescrypt.rb
View
4 lib/aescrypt.rb
@@ -30,11 +30,11 @@
module AESCrypt
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
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")
end

0 comments on commit cff359c

Please sign in to comment.
Something went wrong with that request. Please try again.