crypt19-rb 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/crypt/block_methods.rb +16 -0
- data/lib/crypt/blowfish.rb +3 -16
- data/lib/crypt/gost.rb +3 -16
- data/lib/crypt/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4530ce12b07ff0aeada987cdc41cf9974ff03895
|
4
|
+
data.tar.gz: a99cc84e9d1c4b20134d59ca6e62d33766b7612a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77e7a45bd1461c70d74178c6f62442f14203fe2898518d9b2cf63e370026f3ae2cca28a5daffa4fe5c5e3cece07d30e7d27e3c1ea11a570f4b8bfb20fa3952c3
|
7
|
+
data.tar.gz: bd1f2e21e36055d26a7ed9298edb700338563d25436eba1de7e12a441e870066ea7c61e4bc09e5ec21a40c3efa178d9527cbe4f085594c5e1f49793e003108e9
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BlockMethods
|
2
|
+
def encrypt_block(block)
|
3
|
+
xl, xr = block.unpack('NN')
|
4
|
+
xl, xr = encrypt_pair(xl, xr)
|
5
|
+
encrypted = [xl, xr].pack('NN')
|
6
|
+
return(encrypted)
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def decrypt_block(block)
|
11
|
+
xl, xr = block.unpack('NN')
|
12
|
+
xl, xr = decrypt_pair(xl, xr)
|
13
|
+
decrypted = [xl, xr].pack('NN')
|
14
|
+
return(decrypted)
|
15
|
+
end
|
16
|
+
end
|
data/lib/crypt/blowfish.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
require 'crypt/cbc'
|
6
6
|
require 'crypt/blowfish-tables'
|
7
7
|
require 'crypt/bytes-compat'
|
8
|
+
require 'crypt/block_methods'
|
8
9
|
|
9
10
|
module Crypt
|
10
11
|
class Blowfish
|
@@ -12,6 +13,8 @@ module Crypt
|
|
12
13
|
include Crypt::CBC
|
13
14
|
include Crypt::BlowfishTables
|
14
15
|
|
16
|
+
include BlockMethods
|
17
|
+
|
15
18
|
ULONG = 0x100000000
|
16
19
|
|
17
20
|
def block_size
|
@@ -90,21 +93,5 @@ module Crypt
|
|
90
93
|
return([xl, xr])
|
91
94
|
end
|
92
95
|
|
93
|
-
|
94
|
-
def encrypt_block(block)
|
95
|
-
xl, xr = block.unpack('NN')
|
96
|
-
xl, xr = encrypt_pair(xl, xr)
|
97
|
-
encrypted = [xl, xr].pack('NN')
|
98
|
-
return(encrypted)
|
99
|
-
end
|
100
|
-
|
101
|
-
|
102
|
-
def decrypt_block(block)
|
103
|
-
xl, xr = block.unpack('NN')
|
104
|
-
xl, xr = decrypt_pair(xl, xr)
|
105
|
-
decrypted = [xl, xr].pack('NN')
|
106
|
-
return(decrypted)
|
107
|
-
end
|
108
|
-
|
109
96
|
end
|
110
97
|
end
|
data/lib/crypt/gost.rb
CHANGED
@@ -3,12 +3,15 @@
|
|
3
3
|
# of the Crypto++ project http://www.eskimo.com/~weidai/cryptlib.html
|
4
4
|
|
5
5
|
require 'crypt/cbc'
|
6
|
+
require 'crypt/block_methods'
|
6
7
|
|
7
8
|
module Crypt
|
8
9
|
class Gost
|
9
10
|
|
10
11
|
include CBC
|
11
12
|
|
13
|
+
include BlockMethods
|
14
|
+
|
12
15
|
ULONG = 0x100000000
|
13
16
|
|
14
17
|
def block_size
|
@@ -119,21 +122,5 @@ module Crypt
|
|
119
122
|
return([xr, xl])
|
120
123
|
end
|
121
124
|
|
122
|
-
|
123
|
-
def encrypt_block(block)
|
124
|
-
xl, xr = block.unpack('NN')
|
125
|
-
xl, xr = encrypt_pair(xl, xr)
|
126
|
-
encrypted = [xl, xr].pack('NN')
|
127
|
-
return(encrypted)
|
128
|
-
end
|
129
|
-
|
130
|
-
|
131
|
-
def decrypt_block(block)
|
132
|
-
xl, xr = block.unpack('NN')
|
133
|
-
xl, xr = decrypt_pair(xl, xr)
|
134
|
-
decrypted = [xl, xr].pack('NN')
|
135
|
-
return(decrypted)
|
136
|
-
end
|
137
|
-
|
138
125
|
end
|
139
126
|
end
|
data/lib/crypt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crypt19-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rudenberg
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- Rakefile
|
45
45
|
- VERSION
|
46
46
|
- crypt19.gemspec
|
47
|
+
- lib/crypt/block_methods.rb
|
47
48
|
- lib/crypt/blowfish-tables.rb
|
48
49
|
- lib/crypt/blowfish.rb
|
49
50
|
- lib/crypt/bytes-compat.rb
|