brutus 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/brutus.rb +46 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9c14bb3c5a85a188f8b9e4c942ed6cfec859d5ab
4
+ data.tar.gz: dcb0d3c06b387d6983ede4d88cc9b214d44345aa
5
+ SHA512:
6
+ metadata.gz: 4608e4d2f869153f1d5ac13d7acacb643e37e87b8eb4d0d272c4ce18327d7bfc7eb01538655ac07c9b223aa8c743ea6da20643460c4408ffad1aeecaacfd0229
7
+ data.tar.gz: 3a5b4038c4d98dc1a7e8c96a476ec95d2d7c5c5aacebd2070c6b698d47c6a30faebdddacf27f27e46c347c648ad771055f77422d21f5a9d1c29b1add91bc5e21
data/lib/brutus.rb ADDED
@@ -0,0 +1,46 @@
1
+ require 'digest'
2
+
3
+ class Brutus
4
+
5
+ def self.decipher(key, digest)
6
+ find_letter_match(key, digest)
7
+ end
8
+
9
+ def self.cipher(key, message)
10
+ find_key(key).hexdigest(message)
11
+ end
12
+
13
+ private
14
+
15
+ def self.digest_match?(digest, comparer_digest)
16
+ digest == comparer_digest
17
+ end
18
+
19
+
20
+ def self.find_letter_match(key, digest)
21
+ current_letter = "a"
22
+ current_size = current_letter.size
23
+ new_digest = cipher(key, current_letter)
24
+
25
+ while !digest_match?(digest, new_digest)
26
+ current_letter.next!
27
+ new_digest = cipher(key, current_letter)
28
+
29
+ if current_size < current_letter.size
30
+ current_size = current_letter.size
31
+ puts "currently search through #{current_size} letters"
32
+ end
33
+ end
34
+
35
+ current_letter
36
+ end
37
+
38
+ def self.find_key(key)
39
+ case key
40
+ when 'md5'
41
+ Digest::MD5.new
42
+ when 'sha256'
43
+ Digest::SHA256.new
44
+ end
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brutus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Paulo Ancheta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2012-08-14 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple brute force machine
14
+ email: paulo@brewhouse.io
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/brutus.rb
20
+ homepage: http://github.com/pauloancheta/brutus-gem
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: brutus brute force
44
+ test_files: []