wikk_aes_256 0.1.4 → 0.1.5
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/History.txt +8 -0
- data/lib/wikk_aes_256.rb +7 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceede69c084acaaf29327585241ef70595a0fe25
|
4
|
+
data.tar.gz: 53e0066d40b01a086cb1174c03e97bed115531a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d85b9e214a124dcfedfa167196701ba5e8e1888451897bbfa8fe4af5b95d2bbb304919808b5448251efecde021663a5a21b26976b26cb72b539c4a85df61260
|
7
|
+
data.tar.gz: 3de9e0a324dbc24934c9fd2f6e9f51b752fdaf518f699b77791836e4dc31e6f307fc70a93fb2316bf637e7278f8f5d85e6d83aa888627871fe8d5c46aa09c7d5
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
robertburrowes Thu Jun 23 20:03:38 2016 +1200
|
2
|
+
Embedded digest and initialization vector code into self.gen_key_to_s and self.gen_iv_to_s
|
3
|
+
robertburrowes Wed Jun 22 20:53:26 2016 +1200
|
4
|
+
Write tests that work!
|
5
|
+
robertburrowes Wed Jun 22 20:37:08 2016 +1200
|
6
|
+
Next time the tests
|
7
|
+
robertburrowes Wed Jun 22 18:28:11 2016 +1200
|
8
|
+
Forgot to init @iv, if new was nil iv value
|
1
9
|
robertburrowes Wed Jun 22 15:37:29 2016 +1200
|
2
10
|
Removed trailing \n from base64 packed keys and iv
|
3
11
|
robertburrowes Mon Jun 20 17:58:30 2016 +1200
|
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.5"
|
11
11
|
AES_256_CBC = "AES-256-CBC"
|
12
12
|
|
13
13
|
attr_reader :plain_text, :cipher_text
|
@@ -115,23 +115,22 @@ module WIKK
|
|
115
115
|
#Generates a new key using Digest SHA256 in @key.
|
116
116
|
# @return [String] Base64 encoded string, @key
|
117
117
|
def self.gen_key_to_s
|
118
|
-
|
119
|
-
|
118
|
+
digest = Digest::SHA256.new
|
119
|
+
digest.update("symetric key")
|
120
|
+
return ([digest.digest].pack('m')).chomp
|
120
121
|
end
|
121
122
|
|
122
123
|
#Generate random AES_256_CBC initialization vector.
|
123
124
|
# @return [String] Base64 encoded initialization vector @iv
|
124
125
|
def self.gen_iv_to_s
|
125
|
-
|
126
|
-
|
127
|
-
end
|
126
|
+
return ([OpenSSL::Cipher::Cipher.new(AES_256_CBC).random_iv].pack('m')).chomp
|
127
|
+
end
|
128
128
|
|
129
129
|
#Generates a new key using Digest SHA256 in @key, and random AES_256_CBC initialization vector in @iv
|
130
130
|
# @return [String] Base64 encoded string, @key
|
131
131
|
# @return [String] Base64 encoded initialization vector @iv
|
132
132
|
def self.gen_key_iv_to_s
|
133
|
-
|
134
|
-
return aes.key_to_s, aes.iv_to_s
|
133
|
+
return self.gen_key_to_s, self.gen_iv_to_s
|
135
134
|
end
|
136
135
|
|
137
136
|
#Encrypts source using AES 256 CBC, using @key and @iv
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikk_aes_256
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Burrowes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hoe-yard
|