hashcheck 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -0
- data/build.sh +2 -0
- data/hashcheck-0.1.1.gem +0 -0
- data/hashcheck-0.1.1.tar.gz +0 -0
- data/hashcheck-0.1.2.gem +0 -0
- data/lib/hashcheck/algorithms.rb +17 -0
- data/lib/hashcheck/check.rb +94 -0
- data/lib/hashcheck/version.rb +1 -1
- data/ruby-hashcheck_0.1.1-1.debian.tar.xz +0 -0
- data/ruby-hashcheck_0.1.1-1.dsc +25 -0
- data/ruby-hashcheck_0.1.1-1_all.deb +0 -0
- data/ruby-hashcheck_0.1.1-1_amd64.changes +31 -0
- data/ruby-hashcheck_0.1.1.orig.tar.gz +1 -0
- data/vendor/cache/diff-lcs-1.3.gem +0 -0
- data/vendor/cache/rake-10.5.0.gem +0 -0
- data/vendor/cache/rspec-3.8.0.gem +0 -0
- data/vendor/cache/rspec-core-3.8.2.gem +0 -0
- data/vendor/cache/rspec-expectations-3.8.4.gem +0 -0
- data/vendor/cache/rspec-mocks-3.8.1.gem +0 -0
- data/vendor/cache/rspec-support-3.8.2.gem +0 -0
- metadata +20 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfa01c29b49f8ac37146fdb1aacddd6a41884dce4547302d15cf46a867668599
|
4
|
+
data.tar.gz: 7048c259826eea4e8b7bf7725cb5ee1389f57e520d1435bfd1caac636cb3224d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f372acce71d77357954c2b27ca2782f35b598f1e98dfeb56914a4145c67beddce6db198164c544b78a87ee4126ffb31b86baea389fea303fc471a710c62d4c8
|
7
|
+
data.tar.gz: 7d76ea2fac7582f92af841c26cd047c28e0bdee3d35b77263f89c6aae9dc9db8397fca0f0f9da07db2e79e4f886cfd1c5c6ac2ccb56cbdd5e1c57cbdea2fda53
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
hashcheck (0.1.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.8.0)
|
12
|
+
rspec-core (~> 3.8.0)
|
13
|
+
rspec-expectations (~> 3.8.0)
|
14
|
+
rspec-mocks (~> 3.8.0)
|
15
|
+
rspec-core (3.8.2)
|
16
|
+
rspec-support (~> 3.8.0)
|
17
|
+
rspec-expectations (3.8.4)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.8.0)
|
20
|
+
rspec-mocks (3.8.1)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-support (3.8.2)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 2.0)
|
30
|
+
hashcheck!
|
31
|
+
rake (~> 10.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
2.0.2
|
data/build.sh
ADDED
data/hashcheck-0.1.1.gem
ADDED
Binary file
|
Binary file
|
data/hashcheck-0.1.2.gem
ADDED
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
ALGORITHMS = ["md4","md5","sha1","sha256","sha384","sha512"]
|
2
|
+
LINUX_ALGORITHMS = ["$1","$2","$2a","$5","$6"]
|
3
|
+
LINUX_DELIMITER = "$"
|
4
|
+
HASH_TYPES = ["linux"]
|
5
|
+
|
6
|
+
#BCrypt::Engine.hash_secret(“password”, “$2a$11$VPCn/Vxf31IjlEQ.oI5Asu”)
|
7
|
+
#BCrypt::Engine.generate_salt(cost)
|
8
|
+
#(?<algorithm>^(\$)(?:1|2a|2|5|6)(?:\$))(?<salt>([a-zA-Z1-9 ]*)\$)(?<hash>[.A-Za-z1-9\/]*)
|
9
|
+
|
10
|
+
#openssl passwd -1 -salt Etg2ExUZ redhat
|
11
|
+
#$6$XXmR3BmV$6StDmCcaE9nJTJul/hh3ZP8.z1VNeHarnrqsSo/aHUqmpP/wO0LrBBdWcJT0H8C.2TZf4xBDyphXLIVCMDfz01
|
12
|
+
|
13
|
+
# $1 = MD5 hashing algorithm.
|
14
|
+
# $2 =Blowfish Algorithm is in use.
|
15
|
+
# $2a=eksblowfish Algorithm
|
16
|
+
# $5 =SHA-256 Algorithm
|
17
|
+
# $6 =SHA-512 Algorithm
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Hashcheck
|
2
|
+
class Check
|
3
|
+
attr_accessor :hash_type,:name,:value,:hash,:salt
|
4
|
+
|
5
|
+
def initialize(value,salt="")
|
6
|
+
@value = value
|
7
|
+
@hash_type = get_hash_type
|
8
|
+
@hash = get_hash
|
9
|
+
@salt = get_salt
|
10
|
+
@name = search
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def get_hash_type
|
16
|
+
if value.start_with?("$2a") && value.length == 60
|
17
|
+
"devise"
|
18
|
+
elsif value.start_with?( '$1', '$2a', '$2',"$5","$6")
|
19
|
+
"linux"
|
20
|
+
elsif value.start_with?( "*")
|
21
|
+
"mysql"
|
22
|
+
elsif value.start_with?("md5")
|
23
|
+
"postgres"
|
24
|
+
else
|
25
|
+
"plain"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_salt()
|
31
|
+
case hash_type
|
32
|
+
when "linux"
|
33
|
+
value.split("$")[2]
|
34
|
+
when "devise"
|
35
|
+
self.value[0..28]
|
36
|
+
when "mysql"
|
37
|
+
""
|
38
|
+
when "postgres"
|
39
|
+
""
|
40
|
+
when "plain"
|
41
|
+
""
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def get_hash()
|
46
|
+
case hash_type
|
47
|
+
when "devise"
|
48
|
+
value[29..59]
|
49
|
+
when "linux"
|
50
|
+
value.split("$")[3]
|
51
|
+
when "mysql"
|
52
|
+
value.gsub("*","")
|
53
|
+
when "postgres"
|
54
|
+
value.gsub("md5","")
|
55
|
+
when "plain"
|
56
|
+
value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def search
|
61
|
+
if hash_type == "linux"
|
62
|
+
case value.split("$")[1]
|
63
|
+
when "1"
|
64
|
+
"MD5".
|
65
|
+
when "2"
|
66
|
+
"Blowfish"
|
67
|
+
when "2a"
|
68
|
+
"eksblowfish"
|
69
|
+
when "5"
|
70
|
+
"SHA-256"
|
71
|
+
when "6"
|
72
|
+
"SHA-512"
|
73
|
+
end
|
74
|
+
else
|
75
|
+
case hash.length
|
76
|
+
when 32
|
77
|
+
"MD5"
|
78
|
+
when 40
|
79
|
+
"SHA-1"
|
80
|
+
when 60
|
81
|
+
"BCrypt"
|
82
|
+
when 64
|
83
|
+
"SHA-256"
|
84
|
+
when 96
|
85
|
+
"SHA-384"
|
86
|
+
when 128
|
87
|
+
"SHA-512"
|
88
|
+
else
|
89
|
+
"not supported"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
data/lib/hashcheck/version.rb
CHANGED
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Format: 3.0 (quilt)
|
2
|
+
Source: ruby-hashcheck
|
3
|
+
Binary: ruby-hashcheck
|
4
|
+
Architecture: all
|
5
|
+
Version: 0.1.1-1
|
6
|
+
Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
|
7
|
+
Uploaders: <>
|
8
|
+
Homepage: http://github.com
|
9
|
+
Standards-Version: 3.9.7
|
10
|
+
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-hashcheck.git
|
11
|
+
Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-hashcheck.git
|
12
|
+
Testsuite: autopkgtest-pkg-ruby
|
13
|
+
Build-Depends: debhelper (>= 9~), gem2deb
|
14
|
+
Package-List:
|
15
|
+
ruby-hashcheck deb ruby optional arch=all
|
16
|
+
Checksums-Sha1:
|
17
|
+
064debf21f7f30c78540ce27128da0edffbde07c 5585 ruby-hashcheck_0.1.1.orig.tar.gz
|
18
|
+
9f813ba16779d23d18441711d4bb405058190c7e 1652 ruby-hashcheck_0.1.1-1.debian.tar.xz
|
19
|
+
Checksums-Sha256:
|
20
|
+
3174844d1f8e9d1e37a9fd78a13aeec5394695d3d71c6bff5764690240c827d6 5585 ruby-hashcheck_0.1.1.orig.tar.gz
|
21
|
+
62f5b34ed0436b1e5b6a60ef8ef0fce421b9bd8ffd2df9372de5eecd415b2678 1652 ruby-hashcheck_0.1.1-1.debian.tar.xz
|
22
|
+
Files:
|
23
|
+
fd81534675450b8d6b6924a6d1f78a22 5585 ruby-hashcheck_0.1.1.orig.tar.gz
|
24
|
+
77872d07ec536e83a746d5ac8874479b 1652 ruby-hashcheck_0.1.1-1.debian.tar.xz
|
25
|
+
Ruby-Versions: all
|
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Format: 1.8
|
2
|
+
Date: Mon, 14 Oct 2019 22:45:05 +0530
|
3
|
+
Source: ruby-hashcheck
|
4
|
+
Binary: ruby-hashcheck
|
5
|
+
Architecture: source all
|
6
|
+
Version: 0.1.1-1
|
7
|
+
Distribution: UNRELEASED
|
8
|
+
Urgency: medium
|
9
|
+
Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
|
10
|
+
Changed-By: Akhilesh <akhilesh@IMCHLT143>
|
11
|
+
Description:
|
12
|
+
ruby-hashcheck - Check and returns the kind of algorithm used for hashing
|
13
|
+
Changes:
|
14
|
+
ruby-hashcheck (0.1.1-1) UNRELEASED; urgency=medium
|
15
|
+
.
|
16
|
+
* Initial release (Closes: #nnnn)
|
17
|
+
Checksums-Sha1:
|
18
|
+
28d0256839d4ecb243637195b80589d4ebf9ffd1 1135 ruby-hashcheck_0.1.1-1.dsc
|
19
|
+
064debf21f7f30c78540ce27128da0edffbde07c 5585 ruby-hashcheck_0.1.1.orig.tar.gz
|
20
|
+
9f813ba16779d23d18441711d4bb405058190c7e 1652 ruby-hashcheck_0.1.1-1.debian.tar.xz
|
21
|
+
686dadb57aea7fffccc9f008e0f270963db00d0f 4060 ruby-hashcheck_0.1.1-1_all.deb
|
22
|
+
Checksums-Sha256:
|
23
|
+
745f26902d91f7db129dd2dd878b82ecfc3ed0e7868877dbb763c915bb5ef08c 1135 ruby-hashcheck_0.1.1-1.dsc
|
24
|
+
3174844d1f8e9d1e37a9fd78a13aeec5394695d3d71c6bff5764690240c827d6 5585 ruby-hashcheck_0.1.1.orig.tar.gz
|
25
|
+
62f5b34ed0436b1e5b6a60ef8ef0fce421b9bd8ffd2df9372de5eecd415b2678 1652 ruby-hashcheck_0.1.1-1.debian.tar.xz
|
26
|
+
9fb486ae2473abb6653810122dca4fd8ea878d29f6ff064793744e70990f03dc 4060 ruby-hashcheck_0.1.1-1_all.deb
|
27
|
+
Files:
|
28
|
+
7478f1515e2d5ca7dd49a8dc5f5550f3 1135 ruby optional ruby-hashcheck_0.1.1-1.dsc
|
29
|
+
fd81534675450b8d6b6924a6d1f78a22 5585 ruby optional ruby-hashcheck_0.1.1.orig.tar.gz
|
30
|
+
77872d07ec536e83a746d5ac8874479b 1652 ruby optional ruby-hashcheck_0.1.1-1.debian.tar.xz
|
31
|
+
a38a7e93cbc413fbe923a96d51ff6d42 4060 ruby optional ruby-hashcheck_0.1.1-1_all.deb
|
@@ -0,0 +1 @@
|
|
1
|
+
./hashcheck-0.1.1.tar.gz
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akhil
|
@@ -65,15 +65,34 @@ files:
|
|
65
65
|
- ".travis.yml"
|
66
66
|
- CODE_OF_CONDUCT.md
|
67
67
|
- Gemfile
|
68
|
+
- Gemfile.lock
|
68
69
|
- LICENSE.txt
|
69
70
|
- README.md
|
70
71
|
- Rakefile
|
71
72
|
- bin/console
|
72
73
|
- bin/hashcheck
|
73
74
|
- bin/setup
|
75
|
+
- build.sh
|
76
|
+
- hashcheck-0.1.1.gem
|
77
|
+
- hashcheck-0.1.1.tar.gz
|
78
|
+
- hashcheck-0.1.2.gem
|
74
79
|
- hashcheck.gemspec
|
75
80
|
- lib/hashcheck.rb
|
81
|
+
- lib/hashcheck/algorithms.rb
|
82
|
+
- lib/hashcheck/check.rb
|
76
83
|
- lib/hashcheck/version.rb
|
84
|
+
- ruby-hashcheck_0.1.1-1.debian.tar.xz
|
85
|
+
- ruby-hashcheck_0.1.1-1.dsc
|
86
|
+
- ruby-hashcheck_0.1.1-1_all.deb
|
87
|
+
- ruby-hashcheck_0.1.1-1_amd64.changes
|
88
|
+
- ruby-hashcheck_0.1.1.orig.tar.gz
|
89
|
+
- vendor/cache/diff-lcs-1.3.gem
|
90
|
+
- vendor/cache/rake-10.5.0.gem
|
91
|
+
- vendor/cache/rspec-3.8.0.gem
|
92
|
+
- vendor/cache/rspec-core-3.8.2.gem
|
93
|
+
- vendor/cache/rspec-expectations-3.8.4.gem
|
94
|
+
- vendor/cache/rspec-mocks-3.8.1.gem
|
95
|
+
- vendor/cache/rspec-support-3.8.2.gem
|
77
96
|
homepage: http://github.com
|
78
97
|
licenses:
|
79
98
|
- MIT
|