c7decrypt 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.
- data/lib/c7decrypt.rb +2 -2
- metadata +4 -4
data/lib/c7decrypt.rb
CHANGED
@@ -30,7 +30,7 @@ class C7Decrypt
|
|
30
30
|
def decrypt(pw)
|
31
31
|
r = ""
|
32
32
|
pw_bytes = pw.scan(/../)
|
33
|
-
vt_index = pw_bytes.first.
|
33
|
+
vt_index = pw_bytes.first.to_i - 1
|
34
34
|
pw_bytes.each_with_index do |byte,i|
|
35
35
|
r += (byte.hex^VT_TABLE[(i + vt_index) % 53]).chr
|
36
36
|
end
|
@@ -46,7 +46,7 @@ class C7Decrypt
|
|
46
46
|
pt_chars = plain_text.scan(/./)
|
47
47
|
pt_chars.each_with_index do |char,i|
|
48
48
|
tmp = nil
|
49
|
-
tmp = char.unpack('C')[0] ^ VT_TABLE[(i + seed)]
|
49
|
+
tmp = char.unpack('C')[0] ^ VT_TABLE[((i + seed) % 53)]
|
50
50
|
etext += ("%02X" % tmp)
|
51
51
|
end
|
52
52
|
return etext
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c7decrypt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan Claudius
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-01-10 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: A library for decoding Cisco Type 7 passwords
|