haiti-hash 0.0.1 → 1.1.2

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +2 -1
  3. data/bin/haiti +7 -17
  4. data/data/commons.json +29 -0
  5. data/data/prototypes.json +807 -54
  6. data/lib/haiti.rb +8 -1
  7. data/lib/haiti/version.rb +1 -1
  8. metadata +29 -77
  9. data/.editorconfig +0 -21
  10. data/.gitignore +0 -8
  11. data/.rubocop.yml +0 -25
  12. data/.yardopts +0 -4
  13. data/.yardopts-dev +0 -6
  14. data/Gemfile +0 -6
  15. data/Gemfile.lock +0 -56
  16. data/README.md +0 -32
  17. data/Rakefile +0 -10
  18. data/bin/haiti_setup +0 -7
  19. data/docs/.nojekyll +0 -0
  20. data/docs/CHANGELOG.md +0 -3
  21. data/docs/README.md +0 -22
  22. data/docs/_coverpage.md +0 -15
  23. data/docs/_media/logo.png +0 -0
  24. data/docs/_navbar.md +0 -2
  25. data/docs/_sidebar.md +0 -15
  26. data/docs/about.md +0 -5
  27. data/docs/index.html +0 -31
  28. data/docs/pages/demo.md +0 -3
  29. data/docs/pages/documentation.md +0 -34
  30. data/docs/pages/install.md +0 -90
  31. data/docs/pages/publishing.md +0 -39
  32. data/docs/pages/quick-start.md +0 -39
  33. data/docs/pages/usage.md +0 -58
  34. data/docs/vendor/docsify.js +0 -1
  35. data/docs/vendor/plugins/emoji.min.js +0 -1
  36. data/docs/vendor/plugins/search.min.js +0 -1
  37. data/docs/vendor/prismjs/components/prism-ruby.min.js +0 -1
  38. data/docs/vendor/themes/vue.css +0 -1
  39. data/docs/why.md +0 -35
  40. data/docs/yard/HashIdentifier.html +0 -479
  41. data/docs/yard/HashIdentifier/Chf.html +0 -590
  42. data/docs/yard/Version.html +0 -126
  43. data/docs/yard/_index.html +0 -138
  44. data/docs/yard/class_list.html +0 -51
  45. data/docs/yard/css/common.css +0 -1
  46. data/docs/yard/css/full_list.css +0 -58
  47. data/docs/yard/css/style.css +0 -496
  48. data/docs/yard/file.LICENSE.html +0 -70
  49. data/docs/yard/file.README.html +0 -106
  50. data/docs/yard/file_list.html +0 -61
  51. data/docs/yard/frames.html +0 -17
  52. data/docs/yard/index.html +0 -106
  53. data/docs/yard/js/app.js +0 -303
  54. data/docs/yard/js/full_list.js +0 -216
  55. data/docs/yard/js/jquery.js +0 -4
  56. data/docs/yard/method_list.html +0 -115
  57. data/docs/yard/top-level-namespace.html +0 -112
  58. data/test/test_haiti.rb +0 -33
data/lib/haiti.rb CHANGED
@@ -10,7 +10,8 @@ require 'haiti/hash'
10
10
  class HashIdentifier
11
11
  # Constants
12
12
  include Version
13
- PROTOTYPES = JSON.parse(File.read('data/prototypes.json'))
13
+ PROTOTYPES = JSON.parse(File.read(File.join(__dir__, '../data/prototypes.json')))
14
+ COMMONS = JSON.parse(File.read(File.join(__dir__, '../data/commons.json')))
14
15
 
15
16
  # @return [String] the hash (as provided)
16
17
  # @example
@@ -26,6 +27,7 @@ class HashIdentifier
26
27
  def initialize(hash)
27
28
  @hash = hash
28
29
  @type = identify(hash)
30
+ sort_commons
29
31
  end
30
32
 
31
33
  private
@@ -46,4 +48,9 @@ class HashIdentifier
46
48
  end
47
49
  return res
48
50
  end
51
+
52
+ # Sort common hash types first
53
+ def sort_commons
54
+ @type.sort_by! { |e| COMMONS.include?(e.name) ? 0 : 1 }
55
+ end
49
56
  end
data/lib/haiti/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '0.0.1'
4
+ VERSION = '1.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haiti-hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre ZANNI
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -30,56 +30,56 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.1'
33
+ version: '2.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.1'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '2.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '2.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: commonmarker
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.20'
61
+ version: '0.21'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.20'
68
+ version: '0.21'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: github-markup
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '4.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '4.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.75'
131
+ version: '1.8'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.75'
138
+ version: '1.8'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: yard
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -155,95 +155,47 @@ email: alexandre.zanni@engineer.com
155
155
  executables:
156
156
  - haiti
157
157
  - haiti_console
158
- - haiti_setup
159
158
  extensions: []
160
159
  extra_rdoc_files: []
161
160
  files:
162
- - ".editorconfig"
163
- - ".gitignore"
164
- - ".rubocop.yml"
165
- - ".yardopts"
166
- - ".yardopts-dev"
167
- - Gemfile
168
- - Gemfile.lock
169
161
  - LICENSE.txt
170
- - README.md
171
- - Rakefile
172
162
  - bin/haiti
173
163
  - bin/haiti_console
174
- - bin/haiti_setup
164
+ - data/commons.json
175
165
  - data/prototypes.json
176
- - docs/.nojekyll
177
- - docs/CHANGELOG.md
178
- - docs/README.md
179
- - docs/_coverpage.md
180
- - docs/_media/logo.png
181
- - docs/_navbar.md
182
- - docs/_sidebar.md
183
- - docs/about.md
184
- - docs/index.html
185
- - docs/pages/demo.md
186
- - docs/pages/documentation.md
187
- - docs/pages/install.md
188
- - docs/pages/publishing.md
189
- - docs/pages/quick-start.md
190
- - docs/pages/usage.md
191
- - docs/vendor/docsify.js
192
- - docs/vendor/plugins/emoji.min.js
193
- - docs/vendor/plugins/search.min.js
194
- - docs/vendor/prismjs/components/prism-ruby.min.js
195
- - docs/vendor/themes/vue.css
196
- - docs/why.md
197
- - docs/yard/HashIdentifier.html
198
- - docs/yard/HashIdentifier/Chf.html
199
- - docs/yard/Version.html
200
- - docs/yard/_index.html
201
- - docs/yard/class_list.html
202
- - docs/yard/css/common.css
203
- - docs/yard/css/full_list.css
204
- - docs/yard/css/style.css
205
- - docs/yard/file.LICENSE.html
206
- - docs/yard/file.README.html
207
- - docs/yard/file_list.html
208
- - docs/yard/frames.html
209
- - docs/yard/index.html
210
- - docs/yard/js/app.js
211
- - docs/yard/js/full_list.js
212
- - docs/yard/js/jquery.js
213
- - docs/yard/method_list.html
214
- - docs/yard/top-level-namespace.html
215
166
  - lib/haiti.rb
216
167
  - lib/haiti/hash.rb
217
168
  - lib/haiti/version.rb
218
- - test/test_haiti.rb
219
- homepage: https://orange-cyberdefense.github.io/haiti/
169
+ homepage: https://noraj.github.io/haiti/
220
170
  licenses:
221
171
  - MIT
222
172
  metadata:
223
173
  yard.run: yard
224
- bug_tracker_uri: https://github.com/Orange-Cyberdefense/haiti/issues
225
- changelog_uri: https://github.com/Orange-Cyberdefense/haiti/blob/master/docs/CHANGELOG.md
226
- documentation_uri: https://orange-cyberdefense.github.io/haiti/
227
- homepage_uri: https://orange-cyberdefense.github.io/haiti/
228
- source_code_uri: https://github.com/Orange-Cyberdefense/haiti/
229
- post_install_message:
174
+ bug_tracker_uri: https://github.com/noraj/haiti/issues
175
+ changelog_uri: https://github.com/noraj/haiti/blob/master/docs/CHANGELOG.md
176
+ documentation_uri: https://noraj.github.io/haiti/
177
+ homepage_uri: https://noraj.github.io/haiti/
178
+ source_code_uri: https://github.com/noraj/haiti/
179
+ post_install_message:
230
180
  rdoc_options: []
231
181
  require_paths:
232
182
  - lib
233
183
  required_ruby_version: !ruby/object:Gem::Requirement
234
184
  requirements:
235
- - - "~>"
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 2.4.0
188
+ - - "<"
236
189
  - !ruby/object:Gem::Version
237
- version: '2.4'
190
+ version: '3.1'
238
191
  required_rubygems_version: !ruby/object:Gem::Requirement
239
192
  requirements:
240
193
  - - ">="
241
194
  - !ruby/object:Gem::Version
242
195
  version: '0'
243
196
  requirements: []
244
- rubygems_version: 3.0.1
245
- signing_key:
197
+ rubygems_version: 3.2.15
198
+ signing_key:
246
199
  specification_version: 4
247
200
  summary: HAsh IdenTifIer
248
- test_files:
249
- - test/test_haiti.rb
201
+ test_files: []
data/.editorconfig DELETED
@@ -1,21 +0,0 @@
1
- # EditorConfig: https://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- # Unix-style newlines with a newline ending every file
7
- [*]
8
- end_of_line = lf
9
- insert_final_newline = true
10
-
11
- # ruby
12
- [*.rb]
13
- charset = utf-8
14
- indent_style = space
15
- indent_size = 2
16
- trim_trailing_whitespace = true
17
-
18
- # keep source format
19
- [data/prototypes.json]
20
- indent_style = space
21
- indent_size = 4
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- .yardoc
2
- *.gem
3
- /pkg
4
- /doc
5
- /vendor
6
- .bundle/
7
- /node_modules
8
- .git
data/.rubocop.yml DELETED
@@ -1,25 +0,0 @@
1
- # Metrics
2
- AllCops:
3
- TargetRubyVersion: 2.4
4
-
5
- Layout/AlignHash:
6
- Include:
7
- - 'lib/**/*.rb'
8
- Metrics/AbcSize:
9
- Enabled: false
10
- Metrics/ClassLength:
11
- Max: 200
12
- Metrics/CyclomaticComplexity:
13
- Enabled: false
14
- Metrics/LineLength:
15
- Include:
16
- - 'lib/**/*.rb'
17
- Metrics/BlockNesting:
18
- Exclude:
19
- - 'bin/*'
20
- Metrics/MethodLength:
21
- Max: 25
22
- Metrics/PerceivedComplexity:
23
- Max: 10
24
- Style/RedundantReturn:
25
- Enabled: false
data/.yardopts DELETED
@@ -1,4 +0,0 @@
1
- --output-dir docs/yard
2
- -
3
- --main README.md
4
- LICENSE.txt
data/.yardopts-dev DELETED
@@ -1,6 +0,0 @@
1
- --output-dir docs/yard
2
- --protected
3
- --private
4
- -
5
- --main README.md
6
- LICENSE.txt
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in .gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,56 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- haiti-hash (0.0.1)
5
- docopt (~> 0.6)
6
- paint (~> 2.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.0)
12
- commonmarker (0.20.1)
13
- ruby-enum (~> 0.5)
14
- concurrent-ruby (1.1.5)
15
- docopt (0.6.1)
16
- github-markup (3.0.4)
17
- i18n (1.7.0)
18
- concurrent-ruby (~> 1.0)
19
- jaro_winkler (1.5.3)
20
- minitest (5.12.2)
21
- paint (2.1.1)
22
- parallel (1.18.0)
23
- parser (2.6.5.0)
24
- ast (~> 2.4.0)
25
- rainbow (3.0.0)
26
- rake (13.0.0)
27
- redcarpet (3.5.0)
28
- rubocop (0.75.1)
29
- jaro_winkler (~> 1.5.1)
30
- parallel (~> 1.10)
31
- parser (>= 2.6)
32
- rainbow (>= 2.2.2, < 4.0)
33
- ruby-progressbar (~> 1.7)
34
- unicode-display_width (>= 1.4.0, < 1.7)
35
- ruby-enum (0.7.2)
36
- i18n
37
- ruby-progressbar (1.10.1)
38
- unicode-display_width (1.6.0)
39
- yard (0.9.20)
40
-
41
- PLATFORMS
42
- ruby
43
-
44
- DEPENDENCIES
45
- bundler (~> 2.0)
46
- commonmarker (~> 0.20)
47
- github-markup (~> 3.0)
48
- haiti-hash!
49
- minitest (~> 5.12)
50
- rake (~> 13.0)
51
- redcarpet (~> 3.5)
52
- rubocop (~> 0.75)
53
- yard (~> 0.9)
54
-
55
- BUNDLED WITH
56
- 2.0.2
data/README.md DELETED
@@ -1,32 +0,0 @@
1
- # HAITI
2
-
3
- [![Gem Version](https://badge.fury.io/rb/haiti.svg)](https://badge.fury.io/rb/haiti-hash)
4
- ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/Orange-Cyberdefense/haiti)
5
- [![GitHub forks](https://img.shields.io/github/forks/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/network)
6
- [![GitHub stars](https://img.shields.io/github/stars/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/stargazers)
7
- [![GitHub license](https://img.shields.io/github/license/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/blob/master/LICENSE.txt)
8
-
9
- [![Packaging status](https://repology.org/badge/vertical-allrepos/haiti.svg)](https://repology.org/project/haiti/versions)
10
-
11
- ![](https://orange-cyberdefense.github.io/haiti/_media/logo.png)
12
-
13
- > _**HA**sh **I**den**T**if**I**er_
14
-
15
- ## What is it?
16
-
17
- A CLI tool to identify the hash type of a given hash.
18
-
19
- ## Features
20
-
21
- - 270+ hash types detected
22
- - Hashcat and John the Ripper references
23
- - CLI tool & library
24
- - Hackable
25
-
26
- ## References
27
-
28
- Homepage / Documentation: https://orange-cyberdefense.github.io/haiti/
29
-
30
- ## Author
31
-
32
- Made by Alexandre ZANNI ([@noraj](https://github.com/noraj)), pentester from Orange Cyberdefense.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'rake/testtask'
2
- require 'bundler/gem_tasks'
3
-
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
6
- end
7
-
8
- desc 'Run tests'
9
- task default: :test
10
-
data/bin/haiti_setup DELETED
@@ -1,7 +0,0 @@
1
-
2
- #!/usr/bin/env bash
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
- set -vx
6
-
7
- bundle install
data/docs/.nojekyll DELETED
File without changes
data/docs/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- ## [0.0.1]
2
-
3
- - Initial version