bcrypt_pbkdf 1.0.0-x86-mingw32 → 1.0.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Gemfile.lock +5 -10
- data/README.md +15 -0
- data/bcrypt_pbkdf.gemspec +2 -3
- data/ext/mri/includes.h +1 -1
- data/lib/2.0/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.1/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.2/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.3/bcrypt_pbkdf_ext.so +0 -0
- data/test/bcrypt_pnkdf/engine_test.rb +9 -11
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a4ad32f7c5a9bf18606c1557967b22aa6817ff5
|
4
|
+
data.tar.gz: 44a0bc3f4df2b56f1c4995275a88846895158b9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f56634799d85662e6906011ff911b1b338ff0484c8621e3f4d6067b5d13cda2cfd9089f0eda861ecaf88fafc69057595253836e9553e0ade65b6acdae74aa5c6
|
7
|
+
data.tar.gz: 4af105808a3b198f20ec5e2e1e976395007e244b554fbfb0fc9e2900c006922268643a161d8608d6fa96bbefec932935fabf0dad67d5a51e2c9a59359a671552
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bcrypt_pbkdf (1.0.
|
4
|
+
bcrypt_pbkdf (1.0.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
json (1.8.3)
|
9
|
+
json (1.8.6)
|
11
10
|
minitest (5.8.3)
|
11
|
+
openssl (2.1.2)
|
12
12
|
rake (11.1.1)
|
13
13
|
rake-compiler (0.9.7)
|
14
14
|
rake
|
15
15
|
rake-compiler-dock (0.5.3)
|
16
|
-
rbnacl (3.3.0)
|
17
|
-
ffi
|
18
|
-
rbnacl-libsodium (1.0.8)
|
19
|
-
rbnacl (~> 3.0, >= 3.0.1)
|
20
16
|
rdoc (3.12.2)
|
21
17
|
json (~> 1.4)
|
22
18
|
|
@@ -26,11 +22,10 @@ PLATFORMS
|
|
26
22
|
DEPENDENCIES
|
27
23
|
bcrypt_pbkdf!
|
28
24
|
minitest (>= 5)
|
25
|
+
openssl
|
29
26
|
rake-compiler (~> 0.9.7)
|
30
27
|
rake-compiler-dock (~> 0.5.3)
|
31
|
-
rbnacl (~> 3.3)
|
32
|
-
rbnacl-libsodium (~> 1.0.8)
|
33
28
|
rdoc (~> 3.12)
|
34
29
|
|
35
30
|
BUNDLED WITH
|
36
|
-
1.
|
31
|
+
1.17.3
|
data/README.md
CHANGED
@@ -13,3 +13,18 @@ bcrypt_pdkfd is a ruby gem implementing bcrypt_pdkfd from OpenBSD. This is curre
|
|
13
13
|
|
14
14
|
http://www.tedunangst.com/flak/post/bcrypt-pbkdf
|
15
15
|
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/bcrypt_pbkdf.c?rev=1.13&content-type=text/x-cvsweb-markup
|
16
|
+
|
17
|
+
# Building
|
18
|
+
|
19
|
+
For windows cross build make sure you checked out the gem source under the home directory
|
20
|
+
|
21
|
+
```sh
|
22
|
+
gem install rake-compiler-docks
|
23
|
+
```
|
24
|
+
|
25
|
+
```sh
|
26
|
+
bundle exec rake compile
|
27
|
+
bundle exec rake test
|
28
|
+
bundle exec rake clean clobber
|
29
|
+
bundle exec rake gem:windows
|
30
|
+
```
|
data/bcrypt_pbkdf.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'bcrypt_pbkdf'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.1'
|
4
4
|
|
5
5
|
s.summary = "OpenBSD's bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based PRF)"
|
6
6
|
s.description = <<-EOF
|
@@ -12,8 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.add_development_dependency 'rake-compiler', '~> 0.9.7'
|
14
14
|
s.add_development_dependency 'minitest', '>= 5'
|
15
|
-
s.add_development_dependency '
|
16
|
-
s.add_development_dependency 'rbnacl-libsodium', '~> 1.0.8'
|
15
|
+
s.add_development_dependency 'openssl'
|
17
16
|
s.add_development_dependency 'rdoc', '~> 3.12'
|
18
17
|
s.add_development_dependency 'rake-compiler-dock', '~> 0.5.3'
|
19
18
|
|
data/ext/mri/includes.h
CHANGED
data/lib/2.0/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
data/lib/2.1/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
data/lib/2.2/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
data/lib/2.3/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'test_helper'
|
3
3
|
|
4
|
-
# bcrypt_pbkdf in ruby
|
5
|
-
require '
|
6
|
-
require 'rbnacl'
|
7
|
-
require 'rbnacl/hash'
|
4
|
+
# bcrypt_pbkdf in ruby
|
5
|
+
require 'openssl'
|
8
6
|
|
9
7
|
BCRYPT_BLOCKS = 8
|
10
8
|
BCRYPT_HASHSIZE = BCRYPT_BLOCKS * 4
|
@@ -13,7 +11,7 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
13
11
|
stride = (keylen + BCRYPT_HASHSIZE - 1) / BCRYPT_HASHSIZE
|
14
12
|
amt = (keylen + stride - 1) / stride
|
15
13
|
|
16
|
-
sha2pass =
|
14
|
+
sha2pass = OpenSSL::Digest::SHA512.new(password).digest
|
17
15
|
#puts "[RB] sha2pass:#{sha2pass.inspect} #{sha2pass.size}"
|
18
16
|
|
19
17
|
remlen = keylen
|
@@ -32,13 +30,13 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
32
30
|
countsalt[saltlen + 3] = (count & 0xff).chr
|
33
31
|
#puts "[RC] countsalt: #{countsalt.inspect} len:#{countsalt.size}"
|
34
32
|
|
35
|
-
sha2salt =
|
33
|
+
sha2salt = OpenSSL::Digest::SHA512.new(countsalt).digest
|
36
34
|
tmpout = BCryptPbkdf::Engine::__bc_crypt_hash(sha2pass, sha2salt)
|
37
35
|
out = tmpout.clone
|
38
36
|
|
39
37
|
#puts "[RB] out: #{out.inspect} keylen:#{remlen} count:#{count}"
|
40
38
|
(1...rounds).each do |i|
|
41
|
-
sha2salt =
|
39
|
+
sha2salt = OpenSSL::Digest::SHA512.new(tmpout).digest
|
42
40
|
tmpout = BCryptPbkdf::Engine::__bc_crypt_hash(sha2pass, sha2salt)
|
43
41
|
out.bytes.each_with_index {|o,j| out.setbyte(j,o ^ tmpout[j].ord) }
|
44
42
|
end
|
@@ -48,7 +46,7 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
48
46
|
dest = i * stride + (count -1)
|
49
47
|
key[dest] = out[i] if (dest < keylen)
|
50
48
|
end
|
51
|
-
|
49
|
+
|
52
50
|
remlen -= amt
|
53
51
|
count += 1
|
54
52
|
end
|
@@ -66,13 +64,13 @@ class TestExt < MiniTest::Unit::TestCase
|
|
66
64
|
assert_equal bcrypt_pbkdf(p,s,l,r), BCryptPbkdf::key(p,s,l,r)
|
67
65
|
end
|
68
66
|
end
|
69
|
-
|
67
|
+
|
70
68
|
|
71
69
|
def table
|
72
70
|
[
|
73
|
-
["pass2", "salt2", 12, 2, [214, 14, 48, 162, 131, 206, 121, 176, 50, 104, 231, 252]],
|
71
|
+
["pass2", "salt2", 12, 2, [214, 14, 48, 162, 131, 206, 121, 176, 50, 104, 231, 252]],
|
74
72
|
["\u0000\u0001foo", "\u0001\u0002fooo3", 14, 5, [46, 189, 32, 185, 94, 85, 232, 10, 84, 26, 44, 161, 49, 126]],
|
75
73
|
["doozoasd", "fooo$AS!", 14, 22, [57, 62, 50, 107, 70, 155, 65, 5, 129, 211, 189, 169, 188, 65]]
|
76
74
|
]
|
77
75
|
end
|
78
|
-
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcrypt_pbkdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Miklos Fazekas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -39,33 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: openssl
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.3'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.3'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rbnacl-libsodium
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rdoc
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|