easy_cipher 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy_cipher/cipher.rb +3 -1
- data/lib/easy_cipher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fc5872680808f09db845d339ef93d4d883c70d
|
4
|
+
data.tar.gz: 31d4cf5bd1c6dd0631e6fe8cfd594139c1a99efd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce6acffd4b3d174550f631f167ba4c1ef31307138ebe9eb896a4f49d04febdb433e2d7533580b2be68c48aace4628efa3beb6626fecfb6ecbb97a9a6a9fd4ebe
|
7
|
+
data.tar.gz: 407810733d261f3081a1b1e067c649ddb83618d3d438142f09558e05fa6e0b33a8c663b7e1426c35685a172a06ae7b1c248db08e8f2e08e67366e1674dfdfa1a
|
data/lib/easy_cipher/cipher.rb
CHANGED
@@ -66,13 +66,14 @@ class EasyCipher::Cipher
|
|
66
66
|
# @param encrypted_data [String] Base64 representation of the encrypted data.
|
67
67
|
# @return [String] The decrypted data.
|
68
68
|
def decrypt(encrypted_data)
|
69
|
-
return decrypt_line(Base64.decode64(encrypted_data))
|
69
|
+
return decrypt_line(Base64.decode64(encrypted_data), true)
|
70
70
|
end
|
71
71
|
|
72
72
|
|
73
73
|
|
74
74
|
protected
|
75
75
|
def encrypt_line(line, final = true)
|
76
|
+
@encryptor.reset
|
76
77
|
output = @encryptor.update(line)
|
77
78
|
if final
|
78
79
|
output << @encryptor.final
|
@@ -82,6 +83,7 @@ class EasyCipher::Cipher
|
|
82
83
|
|
83
84
|
|
84
85
|
def decrypt_line(line, final = true)
|
86
|
+
@decryptor.reset
|
85
87
|
output = @decryptor.update(line)
|
86
88
|
if final
|
87
89
|
output << @decryptor.final
|
data/lib/easy_cipher/version.rb
CHANGED