cobreak 0.0.3
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 +7 -0
- data/Gemfile +15 -0
- data/LICENSE +700 -0
- data/README.md +74 -0
- data/bin/cobreak +11 -0
- data/cobreak.gemspec +12 -0
- data/dicc.txt +1 -0
- data/diccionario.txt +275 -0
- data/hola.txt +1397760 -0
- data/lib/cobreak.rb +3 -0
- data/lib/cobreak/Cesar.rb +35 -0
- data/lib/cobreak/cifrado.rb +32 -0
- data/lib/cobreak/cobreak.rb +193 -0
- data/lib/cobreak/decifrado.rb +32 -0
- data/lib/cobreak/decrypt.rb +110 -0
- data/lib/cobreak/details.rb +19 -0
- data/lib/cobreak/encrypt.rb +55 -0
- data/lib/cobreak/force.rb +227 -0
- data/lib/cobreak/force_brute.rb +81 -0
- data/lib/cobreak/function_db.rb +27 -0
- data/lib/cobreak/function_hash.rb +29 -0
- data/lib/cobreak/hash/hash.db +29 -0
- data/lib/cobreak/info_author.rb +22 -0
- data/lib/cobreak/list_all.rb +19 -0
- data/lib/cobreak/optionpr.rb +59 -0
- data/lib/cobreak/run.rb +9 -0
- data/lib/cobreak/show/md4.db +6 -0
- data/lib/cobreak/show/md5.db +14 -0
- data/lib/cobreak/show/ripemd160.db +1 -0
- data/lib/cobreak/show/sha1.db +3 -0
- data/lib/cobreak/show/sha224.db +1 -0
- data/lib/cobreak/show/sha256.db +1 -0
- data/lib/cobreak/show/sha384.db +1 -0
- data/lib/cobreak/show/sha512.db +1 -0
- data/lib/cobreak/version.rb +5 -0
- data/prueba.txt +2 -0
- metadata +78 -0
data/lib/cobreak.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
class CesarCifrado
|
2
|
+
attr_accessor :dato
|
3
|
+
def initialize(dato = nil)
|
4
|
+
@dato = dato
|
5
|
+
end
|
6
|
+
def cesar(dato, rotasiones, orientacion = 1)
|
7
|
+
alfa_mayus = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
8
|
+
alfa_minus = "abcdefghijklmnopqrstuvwxyz"
|
9
|
+
alf = 26
|
10
|
+
lit_mayus = 65
|
11
|
+
lit_minus = 97
|
12
|
+
cad_rot = ""
|
13
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m CipherText: "
|
14
|
+
for letra in dato.chars
|
15
|
+
if !letra.match(/^[[:alpha:]]$/)
|
16
|
+
cad_rot += letra
|
17
|
+
next
|
18
|
+
end
|
19
|
+
alfabeto = alfa_mayus
|
20
|
+
limit = lit_mayus
|
21
|
+
if letra == letra.downcase
|
22
|
+
alfabeto = alfa_minus
|
23
|
+
limit = lit_minus
|
24
|
+
end
|
25
|
+
var_ascii = letra.ord
|
26
|
+
rot_ver = rotasiones * orientacion
|
27
|
+
new_pos = (var_ascii - limit + rot_ver) % alf
|
28
|
+
cad_rot = alfabeto[new_pos]
|
29
|
+
print cad_rot
|
30
|
+
end
|
31
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Rotations Number: #{rotasiones}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
CifraCesar = CesarCifrado.new
|
35
|
+
DecifraCesar = CesarCifrado.new
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'base32'
|
3
|
+
require 'base16'
|
4
|
+
require 'ascii85'
|
5
|
+
|
6
|
+
class Cifrado
|
7
|
+
attr_accessor :data
|
8
|
+
def initialize(data = nil)
|
9
|
+
@data = data
|
10
|
+
end
|
11
|
+
def base16(dato)
|
12
|
+
bas16 = Base16.encode16(dato)
|
13
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas16}\e[0m"
|
14
|
+
end
|
15
|
+
def base32(dato)
|
16
|
+
bas32 = Base32.encode(dato)
|
17
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas32}\e[0m"
|
18
|
+
end
|
19
|
+
def base64(dato)
|
20
|
+
bas64 = Base64.encode64(dato)
|
21
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas64}"
|
22
|
+
end
|
23
|
+
def binary(dato)
|
24
|
+
result = dato.unpack("B*").join('')
|
25
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{result}"
|
26
|
+
end
|
27
|
+
def ascii85(dato)
|
28
|
+
asci85 = Ascii85.encode(dato)
|
29
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{asci85}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
Cifra = Cifrado.new
|
@@ -0,0 +1,193 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
module CoBreak
|
3
|
+
class Box
|
4
|
+
def self.var(options)
|
5
|
+
@options = options
|
6
|
+
$options = options
|
7
|
+
end
|
8
|
+
begin
|
9
|
+
require 'cobreak/cifrado'
|
10
|
+
require 'cobreak/decifrado'
|
11
|
+
require 'cobreak/Cesar'
|
12
|
+
require 'cobreak/encrypt'
|
13
|
+
require 'cobreak/decrypt'
|
14
|
+
rescue LoadError => e
|
15
|
+
puts e.message
|
16
|
+
puts "A file is missing from the repository"
|
17
|
+
puts ""
|
18
|
+
exit(1)
|
19
|
+
end
|
20
|
+
#encoding and decoding algoritmhs
|
21
|
+
class Cipher
|
22
|
+
def self.coding()
|
23
|
+
@options = $options
|
24
|
+
@options.enc = "" if @options.enc.nil? == true
|
25
|
+
@options.dec = "" if @options.dec.nil? == true
|
26
|
+
if (@options.enc.casecmp?('base16')) or (@options.dec.casecmp?('base16'));
|
27
|
+
if (File.exists?(@options.algo));
|
28
|
+
IO.foreach(@options.algo){|line|
|
29
|
+
line.chomp!
|
30
|
+
Cifra::base16(line.to_s) if (@options.enc.casecmp?('base16'))
|
31
|
+
Decifra::base16(line.to_s) if (@options.dec.casecmp?('base16'))
|
32
|
+
}
|
33
|
+
else;
|
34
|
+
Cifra::base16(@options.algo.to_s) if (@options.enc.casecmp?('base16'))
|
35
|
+
Decifra::base16(@options.algo.to_s) if (@options.dec.casecmp?('base16'))
|
36
|
+
end
|
37
|
+
elsif (@options.enc.casecmp?('base32')) or (@options.dec.casecmp?('base32'));
|
38
|
+
if (File.exists?(@options.algo));
|
39
|
+
IO.foreach(@options.algo){|line|
|
40
|
+
line.chomp!
|
41
|
+
Cifra::base32(line.to_s) if (@options.enc.casecmp?('base32'))
|
42
|
+
Decifra::base32(line.to_s) if (@options.dec.casecmp('base32'))
|
43
|
+
}
|
44
|
+
else;
|
45
|
+
Cifra::base32(@options.algo.to_s) if (@options.enc.casecmp?('base32'))
|
46
|
+
Decifra::base32(@options.algo.to_s) if (@options.dec.casecmp?('base32'))
|
47
|
+
end
|
48
|
+
elsif (@options.enc.casecmp?('base64')) or (@options.dec.casecmp?('base64'));
|
49
|
+
if (File.exists?(@options.algo));
|
50
|
+
IO.foreach(@options.algo){|line|
|
51
|
+
line.chomp!
|
52
|
+
Cifra::base64(line.to_s) if (@options.enc.casecmp?('base64'))
|
53
|
+
Decifra::base64(line.to_s) if (@options.dec.casecmp?('base64'))
|
54
|
+
}
|
55
|
+
else;
|
56
|
+
Cifra::base64(@options.algo.to_s) if (@options.enc.casecmp?('base64'))
|
57
|
+
Decifra::base64(@options.algo.to_s) if (@options.dec.casecmp?('base64'))
|
58
|
+
end
|
59
|
+
elsif (@options.enc.casecmp?('ascii85')) or (@options.dec.casecmp?('ascii85'));
|
60
|
+
if (File.exists?(@options.algo));
|
61
|
+
IO.foreach(@options.algo){|line|
|
62
|
+
line.chomp!
|
63
|
+
Cifra::ascii85(line.to_s) if (@options.enc.casecmp?('ascii85'))
|
64
|
+
Decifra::ascii85(line.to_s) if (@options.dec.casecmp?('ascii85'))
|
65
|
+
}
|
66
|
+
else;
|
67
|
+
Cifra::ascii85(@options.algo.to_s) if (@options.enc.casecmp?('ascii85'))
|
68
|
+
Decifra::ascii85(@options.algo.to_s) if (@options.dec.casecmp?('ascii85'))
|
69
|
+
end
|
70
|
+
elsif (@options.enc.casecmp?('binary')) or (@options.dec.casecmp?('binary'));
|
71
|
+
if (File.exists?(@options.algo));
|
72
|
+
IO.foreach(@options.algo){|line|
|
73
|
+
line.chomp!
|
74
|
+
Cifra::binary(line.to_s) if (@options.enc.casecmp?('binary'))
|
75
|
+
Decifra::binary(line.to_s) if (@options.dec.casecmp?('binary'))
|
76
|
+
}
|
77
|
+
else;
|
78
|
+
Cifra::binary(@options.algo.to_s) if (@options.enc.casecmp?('binary'))
|
79
|
+
Decifra::binary(@options.algo.to_s) if (@options.dec.casecmp?('binary'))
|
80
|
+
end
|
81
|
+
elsif (@options.enc.casecmp?('cesar')) or (@options.dec.casecmp?('cesar'));
|
82
|
+
dat = ARGV[0]
|
83
|
+
if (File.exists?(@options.algo));
|
84
|
+
IO.foreach(@options.algo){|line|
|
85
|
+
line.chomp!
|
86
|
+
CifraCesar::cesar(line.to_s, dat.to_i) if (@options.enc.casecmp?('cesar'))
|
87
|
+
DecifraCesar::cesar(line.to_s, dat.to_i, -1) if (@options.dec.casecmp?('cesar'))
|
88
|
+
}
|
89
|
+
else;
|
90
|
+
CifraCesar::cesar(@options.algo.to_s, dat.to_i) if (@options.enc.casecmp?('cesar'))
|
91
|
+
DecifraCesar::cesar(@options.algo.to_s, dat.to_i, -1) if (@options.dec.casecmp?('cesar'))
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
class Cryptgraphy
|
97
|
+
def self.crypt()
|
98
|
+
@options = $options
|
99
|
+
@options.encrypt = "" if @options.encrypt.nil? == true
|
100
|
+
@options.decrypt = "" if @options.decrypt.nil? == true
|
101
|
+
if (@options.encrypt.casecmp?("md4")) or (@options.decrypt.casecmp?("md4"));
|
102
|
+
if (File.exists?(@options.algo));
|
103
|
+
IO.foreach(@options.algo){|line|
|
104
|
+
line.chomp!
|
105
|
+
EnCrypt::md4(line) if (@options.encrypt.casecmp?("md4"))
|
106
|
+
DeCrypt::md4(line) if (@options.decrypt.casecmp?("md4"))
|
107
|
+
}
|
108
|
+
else
|
109
|
+
EnCrypt::md4(@options.algo) if (@options.encrypt.casecmp?("md4"))
|
110
|
+
DeCrypt::md4(@options.algo) if (@options.decrypt.casecmp?("md4"))
|
111
|
+
end
|
112
|
+
elsif (@options.encrypt.casecmp?("md5")) or (@options.decrypt.casecmp?("md5"));
|
113
|
+
if (File.exists?(@options.algo));
|
114
|
+
IO.foreach(@options.algo){|line|
|
115
|
+
line.chomp!
|
116
|
+
EnCrypt::md5(line) if (@options.encrypt.casecmp?("md5"))
|
117
|
+
DeCrypt::md5(line) if (@options.decrypt.casecmp?("md5"))
|
118
|
+
}
|
119
|
+
else
|
120
|
+
EnCrypt::md5(@options.algo) if (@options.encrypt.casecmp?("md5"))
|
121
|
+
DeCrypt::md5(@options.algo) if (@options.decrypt.casecmp?("md5"))
|
122
|
+
end
|
123
|
+
elsif (@options.encrypt.casecmp?("sha1")) or (@options.decrypt.casecmp?("sha1"))
|
124
|
+
if (File.exists?(@options.algo));
|
125
|
+
IO.foreach(@options.algo){|line|
|
126
|
+
line.chomp!
|
127
|
+
EnCrypt::sha1(line) if (@options.encrypt.casecmp?("sha1"))
|
128
|
+
DeCrypt::sha1(line) if (@options.decrypt.casecmp?("sha1"))
|
129
|
+
}
|
130
|
+
else
|
131
|
+
EnCrypt::sha1(@options.algo) if (@options.encrypt.casecmp?("sha1"))
|
132
|
+
DeCrypt::sha1(@options.algo) if (@options.decrypt.casecmp?("sha1"))
|
133
|
+
end
|
134
|
+
elsif (@options.encrypt.casecmp?("sha224")) or (@options.decrypt.casecmp?("sha224"));
|
135
|
+
if (File.exists?(@options.algo));
|
136
|
+
IO.foreach(@options.algo){|line|
|
137
|
+
line.chomp!
|
138
|
+
EnCrypt::sha224(line) if (@options.encrypt.casecmp?("sha224"))
|
139
|
+
DeCrypt::sha224(line) if (@options.decrypt.casecmp?("sha224"))
|
140
|
+
}
|
141
|
+
else
|
142
|
+
EnCrypt::sha224(@options.algo) if (@options.encrypt.casecmp?("sha224"))
|
143
|
+
DeCrypt::sha224(@options.algo) if (@options.decrypt.casecmp?("sha224"))
|
144
|
+
end
|
145
|
+
elsif (@options.encrypt.casecmp?("sha256")) or (@options.decrypt.casecmp?("sha256"));
|
146
|
+
if (File.exists?(@options.algo));
|
147
|
+
IO.foreach(@options.algo){|line|
|
148
|
+
line.chomp!
|
149
|
+
EnCrypt::sha256(line) if (@options.encrypt.casecmp?("sha256"))
|
150
|
+
DeCrypt::sha256(line) if (@options.decrypt.casecmp?("sha256"))
|
151
|
+
}
|
152
|
+
else
|
153
|
+
EnCrypt::sha256(@options.algo) if (@options.encrypt.casecmp?("sha256"))
|
154
|
+
DeCrypt::sha256(@options.algo) if (@options.decrypt.casecmp?("sha256"))
|
155
|
+
end
|
156
|
+
elsif (@options.encrypt.casecmp?("sha384")) or (@options.decrypt.casecmp?("sha384"));
|
157
|
+
if (File.exists?(@options.algo));
|
158
|
+
IO.foreach(@options.algo){|line|
|
159
|
+
line.chomp!
|
160
|
+
EnCrypt::sha384(line) if (@options.encrypt.casecmp?("sha384"))
|
161
|
+
DeCrypt::sha384(line) if (@options.decrypt.casecmp?("sha384"))
|
162
|
+
}
|
163
|
+
else
|
164
|
+
EnCrypt::sha384(@options.algo) if (@options.encrypt.casecmp?("sha384"))
|
165
|
+
DeCrypt::sha384(@options.algo) if (@options.decrypt.casecmp?("sha384"))
|
166
|
+
end
|
167
|
+
elsif (@options.encrypt.casecmp?("sha512")) or (@options.decrypt.casecmp?("sha512"));
|
168
|
+
if (File.exists?(@options.algo));
|
169
|
+
IO.foreach(@options.algo){|line|
|
170
|
+
line.chomp!
|
171
|
+
EnCrypt::sha512(line) if (@options.encrypt.casecmp?("sha512"))
|
172
|
+
DeCrypt::sha512(line) if (@options.decrypt.casecmp?("sha512"))
|
173
|
+
}
|
174
|
+
else
|
175
|
+
EnCrypt::sha512(@options.algo) if (@options.encrypt.casecmp?("sha512"))
|
176
|
+
DeCrypt::sha512(@options.algo) if (@options.decrypt.casecmp?("sha512"))
|
177
|
+
end
|
178
|
+
elsif (@options.encrypt.casecmp?("ripemd160")) or (@options.decrypt.casecmp?("ripemd160"));
|
179
|
+
if (File.exists?(@options.algo));
|
180
|
+
IO.foreach(@options.algo){|line|
|
181
|
+
line.chomp!
|
182
|
+
EnCrypt::ripemd160(line) if (@options.encrypt.casecmp?("ripemd160"))
|
183
|
+
DeCrypt::ripemd160(line) if (@options.decrypt.casecmp?("ripemd160"))
|
184
|
+
}
|
185
|
+
else
|
186
|
+
EnCrypt::ripemd160(@options.algo) if (@options.encrypt.casecmp?("ripemd160"))
|
187
|
+
DeCrypt::ripemd160(@options.algo) if (@options.decrypt.casecmp?("ripemd160"))
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'base32'
|
3
|
+
require 'base16'
|
4
|
+
require 'ascii85'
|
5
|
+
|
6
|
+
class Decifrado
|
7
|
+
attr_accessor :data
|
8
|
+
def initialize(data = nil)
|
9
|
+
@data = data
|
10
|
+
end
|
11
|
+
def base16(dato)
|
12
|
+
bas16 = Base16.decode16(dato)
|
13
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas16}\e[0m"
|
14
|
+
end
|
15
|
+
def base32(dato)
|
16
|
+
bas32 = Base32.decode(dato)
|
17
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas32}\e[0m"
|
18
|
+
end
|
19
|
+
def base64(dato)
|
20
|
+
bas64 = Base64.decode64(dato)
|
21
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas64}"
|
22
|
+
end
|
23
|
+
def binary(dato)
|
24
|
+
result = [dato].pack("B*")
|
25
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{result}"
|
26
|
+
end
|
27
|
+
def ascii85(dato)
|
28
|
+
asci85 = Ascii85.decode(dato)
|
29
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{asci85}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
Decifra = Decifrado.new
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
require 'sequel'
|
3
|
+
require 'cobreak/version'
|
4
|
+
class Decrypt
|
5
|
+
def md4(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
|
6
|
+
dbs = Sequel.sqlite
|
7
|
+
dbs.create_table? :hashes do
|
8
|
+
String :original
|
9
|
+
String :hash
|
10
|
+
end
|
11
|
+
IO.foreach(wordlist) {|line|
|
12
|
+
line.chomp!
|
13
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD4.hexdigest(line)}
|
14
|
+
}
|
15
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
16
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
17
|
+
end
|
18
|
+
def md5(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db'))
|
19
|
+
dbs = Sequel.sqlite
|
20
|
+
dbs.create_table? :hashes do
|
21
|
+
String :original
|
22
|
+
String :hash
|
23
|
+
end
|
24
|
+
IO.foreach(wordlist) {|line|
|
25
|
+
line.chomp!
|
26
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD5.hexdigest(line)}
|
27
|
+
}
|
28
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
29
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
30
|
+
end
|
31
|
+
def sha1(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db'))
|
32
|
+
dbs = Sequel.sqlite
|
33
|
+
dbs.create_table? :hashes do
|
34
|
+
String :original
|
35
|
+
String :hash
|
36
|
+
end
|
37
|
+
IO.foreach(wordlist) {|line|
|
38
|
+
line.chomp!
|
39
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA1.hexdigest(line)}
|
40
|
+
}
|
41
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
42
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
43
|
+
end
|
44
|
+
def sha224(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db'))
|
45
|
+
dbs = Sequel.sqlite
|
46
|
+
dbs.create_table? :hashes do
|
47
|
+
String :original
|
48
|
+
String :hash
|
49
|
+
end
|
50
|
+
IO.foreach(wordlist) {|line|
|
51
|
+
line.chomp!
|
52
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA224.hexdigest(line)}
|
53
|
+
}
|
54
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
55
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
56
|
+
end
|
57
|
+
def sha256(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db'))
|
58
|
+
dbs = Sequel.sqlite
|
59
|
+
dbs.create_table? :hashes do
|
60
|
+
String :original
|
61
|
+
String :hash
|
62
|
+
end
|
63
|
+
IO.foreach(wordlist) {|line|
|
64
|
+
line.chomp!
|
65
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA256.hexdigest(line)}
|
66
|
+
}
|
67
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
68
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
69
|
+
end
|
70
|
+
def sha384(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha384.db'))
|
71
|
+
dbs = Sequel.sqlite
|
72
|
+
dbs.create_table? :hashes do
|
73
|
+
String :original
|
74
|
+
String :hash
|
75
|
+
end
|
76
|
+
IO.foreach(wordlist) {|line|
|
77
|
+
line.chomp!
|
78
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA384.hexdigest(line)}
|
79
|
+
}
|
80
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
81
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
82
|
+
end
|
83
|
+
def sha512(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db'))
|
84
|
+
dbs = Sequel.sqlite
|
85
|
+
dbs.create_table? :hashes do
|
86
|
+
String :original
|
87
|
+
String :hash
|
88
|
+
end
|
89
|
+
IO.foreach(wordlist) {|line|
|
90
|
+
line.chomp!
|
91
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA512.hexdigest(line)}
|
92
|
+
}
|
93
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
94
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
95
|
+
end
|
96
|
+
def ripemd160(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db'))
|
97
|
+
dbs = Sequel.sqlite
|
98
|
+
dbs.create_table? :hashes do
|
99
|
+
String :original
|
100
|
+
String :hash
|
101
|
+
end
|
102
|
+
IO.foreach(wordlist) {|line|
|
103
|
+
line.chomp!
|
104
|
+
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::RIPEMD160.hexdigest(line)}
|
105
|
+
}
|
106
|
+
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
107
|
+
puts dbs[:hashes].filter(hash:dato).map(:original)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
DeCrypt = Decrypt.new
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module CoBreak
|
2
|
+
class Details
|
3
|
+
def self.info()
|
4
|
+
return "The CoBreak script is an cipher and cryptography tool made with the purpose of facilitating the encryption of data or others, it includes parameters to brute force the hashes through dictionaries"
|
5
|
+
end
|
6
|
+
def self.dependecias()
|
7
|
+
return %w(base14 base32 base16 ascii85 cesar binary openssl animat sequel sqlite3)
|
8
|
+
end
|
9
|
+
def self.date()
|
10
|
+
return "2020-5-25"
|
11
|
+
end
|
12
|
+
def self.cipher()
|
13
|
+
return %w(base64 base32 base16 ascii85 cesar binary)
|
14
|
+
end
|
15
|
+
def self.crypt()
|
16
|
+
return %w(MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
require 'cobreak/function_db'
|
3
|
+
require 'cobreak/function_hash'
|
4
|
+
require 'cobreak/version'
|
5
|
+
class Encrypt
|
6
|
+
def md4(dato)
|
7
|
+
md4 = OpenSSL::Digest::MD4.hexdigest(dato)
|
8
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + md4
|
9
|
+
$datBas::database(md4)
|
10
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
|
11
|
+
end
|
12
|
+
def md5(dato)
|
13
|
+
md5 = OpenSSL::Digest::MD5.hexdigest(dato)
|
14
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + md5
|
15
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db'))
|
16
|
+
$datBas::database(md5)
|
17
|
+
end
|
18
|
+
def sha1(dato)
|
19
|
+
sha1 = OpenSSL::Digest::SHA1.hexdigest(dato)
|
20
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha1
|
21
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db'))
|
22
|
+
$datBas::database(sha1)
|
23
|
+
end
|
24
|
+
def sha224(dato)
|
25
|
+
sha224 = OpenSSL::Digest::SHA224.hexdigest(dato)
|
26
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha224
|
27
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db'))
|
28
|
+
$datBas::database(sha224)
|
29
|
+
end
|
30
|
+
def sha256(dato)
|
31
|
+
sha256 = OpenSSL::Digest::SHA256.hexdigest(dato)
|
32
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha256
|
33
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db'))
|
34
|
+
$datBas::database(sha256)
|
35
|
+
end
|
36
|
+
def sha384(dato)
|
37
|
+
sha384 = OpenSSL::Digest::SHA384.hexdigest(dato)
|
38
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha384
|
39
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', '384.db'))
|
40
|
+
$datBas::database(sha384)
|
41
|
+
end
|
42
|
+
def sha512(dato)
|
43
|
+
sha512 = OpenSSL::Digest::SHA512.hexdigest(dato)
|
44
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha512
|
45
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db'))
|
46
|
+
$datBas::database(sha512)
|
47
|
+
end
|
48
|
+
def ripemd160(dato)
|
49
|
+
ripemd160 = OpenSSL::Digest::RIPEMD160.hexdigest(dato)
|
50
|
+
puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + ripemd160
|
51
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db'))
|
52
|
+
$datBas::database(ripemd160)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
EnCrypt = Encrypt.new
|