wikk_aes_256 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wikk_aes_256.rb +7 -5
- 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: 46379fa13c271b9c7856dd6b909dea25f3e1cbf8
|
4
|
+
data.tar.gz: 7581a603b8ceddd98fadeb8c85bfd63267b3932e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4de30101f461a246e62841ab0168dbb0327cfe4ef119ce62b0f3c310b3ea3431ebe49cf97391f809aab770c49e3203edb7e6f603468324819f3fb1a7cc32d393
|
7
|
+
data.tar.gz: e101cedc2c534261b9c528501496b4b63d54597ba02fe5770ed5d7ab5559d9d84b82054b2aa0123dcb601b5bcc84b0ac29e5d8d4152fa73f30cea748bd528b46
|
data/lib/wikk_aes_256.rb
CHANGED
@@ -7,7 +7,7 @@ module WIKK
|
|
7
7
|
# @attr_reader [String] plain_text the decrypted text
|
8
8
|
# @attr_reader [String] cipher_text the encrypted text
|
9
9
|
class AES_256
|
10
|
-
VERSION = "0.1.
|
10
|
+
VERSION = "0.1.4"
|
11
11
|
AES_256_CBC = "AES-256-CBC"
|
12
12
|
|
13
13
|
attr_reader :plain_text, :cipher_text
|
@@ -18,13 +18,15 @@ module WIKK
|
|
18
18
|
# @param iv_string [String ] optional base64 iv (initial vector) to be used in the encryption or decryption
|
19
19
|
# Overwritten by auto generated iv, if key_string is nil. Recover with iv_to_str() or key_iv_to_s().
|
20
20
|
def initialize(key_string = nil, iv_string = nil)
|
21
|
-
if
|
21
|
+
if key_string == nil
|
22
22
|
gen_key
|
23
|
-
gen_iv
|
24
|
-
elsif iv_string == nil
|
25
|
-
gen_iv
|
26
23
|
else
|
27
24
|
str_to_key(key_string)
|
25
|
+
end
|
26
|
+
|
27
|
+
if iv_string == nil
|
28
|
+
gen_iv
|
29
|
+
else
|
28
30
|
str_to_iv(iv_string)
|
29
31
|
end
|
30
32
|
end
|