lib/encrypted_strings/extensions/string.rb in encrypted_strings-0.0.4 vs lib/encrypted_strings/extensions/string.rb in encrypted_strings-0.0.5
- old
+ new
@@ -108,10 +108,12 @@
#
# password = "jDACXI5hMPI=\n"
# password.decrypt!(:symmetric, :key => 'my_key') # => "shhhh"
# password # => "shhhh"
def decrypt!(*args)
- replace(decrypt(*args))
+ value = replace(decrypt(*args))
+ self.encryptor = nil
+ value
end
# Can this string be decrypted? Strings can only be decrypted if they
# have previously been decrypted +and+ the encryption algorithm supports
# decryption. To determine whether or not the encryption algorithm