bcrypt_pbkdf 1.0.1.rc1 → 1.0.1

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94d1258a828fbd07a77a5e3d4163f0424660b203
4
- data.tar.gz: 37123cada0cc78feeea6429e2e3c7b1dcf39ce08
3
+ metadata.gz: 6f48bfa6cb34ed011d86077b7db9e705bb767866
4
+ data.tar.gz: 190a384d0683bfe2c8e6de946e25ae237ea70176
5
5
  SHA512:
6
- metadata.gz: 7ed28b98430c90c2f358f46c5b9bdd7de427c5960bbce793f7ac75ab19a9a0b2ebc7ee68d5bdae567dbc82a83ebbded56883499b569d88e2b94df34f69f656fc
7
- data.tar.gz: eef606967079c0911a83a857512777f07df20b706cedfa6db272e3dfc15ae92a6f46989ab2eb813c03ffc613e0e28df158444a7df68568986c972369125d6966
6
+ metadata.gz: 011cafb3a4e5071473d07c7313ccbc01701f0ab2c50318aa2c585eefe14681379b1bbaf31f8675c3e1e8728c86402305975f467920df33cb97561a4726aae1e5
7
+ data.tar.gz: 881231d96178f84dcec1e2961268ec1cc38c4ce54764d0a3b1317c55d8ddebb0039e20a9258d1f59154aaf9cbceaaae67883334e902dfb3b492a7cc2b158818f
@@ -1,22 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bcrypt_pbkdf (1.0.1.rc1)
4
+ bcrypt_pbkdf (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ffi (1.9.10)
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.17.1
31
+ 1.17.3
data/README.md CHANGED
@@ -13,3 +13,19 @@ 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
+ bundle exec rake release
31
+ ```
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rake/testtask'
2
2
  require 'rubygems/package_task'
3
+ require 'bundler/gem_tasks'
3
4
  require 'rake/extensiontask'
4
5
  require 'rake/clean'
5
6
  require 'rdoc/task'
@@ -27,7 +28,7 @@ task :default => [:compile, :spec]
27
28
 
28
29
  desc "Run all tests"
29
30
  Rake::TestTask.new do |t|
30
- #t.pattern =
31
+ #t.pattern =
31
32
  t.test_files = FileList['test/**/*_test.rb']
32
33
  t.ruby_opts = ['-w']
33
34
  t.libs << "test"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'bcrypt_pbkdf'
3
- s.version = '1.0.1.rc1'
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 'rbnacl', '~> 3.3'
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
 
@@ -1,10 +1,8 @@
1
1
  require 'minitest/autorun'
2
2
  require 'test_helper'
3
3
 
4
- # bcrypt_pbkdf in ruby using libsodium
5
- require 'rbnacl/libsodium'
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 = RbNaCl::Hash.sha512(password)
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 = RbNaCl::Hash.sha512(countsalt)
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 = RbNaCl::Hash.sha512(tmpout)
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.1.rc1
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miklos Fazekas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-04 00:00:00.000000000 Z
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: rbnacl
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: 1.0.8
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: 1.0.8
54
+ version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rdoc
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -151,12 +137,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
137
  version: '0'
152
138
  required_rubygems_version: !ruby/object:Gem::Requirement
153
139
  requirements:
154
- - - ">"
140
+ - - ">="
155
141
  - !ruby/object:Gem::Version
156
- version: 1.3.1
142
+ version: '0'
157
143
  requirements: []
158
144
  rubyforge_project:
159
- rubygems_version: 2.5.2.3
145
+ rubygems_version: 2.6.8
160
146
  signing_key:
161
147
  specification_version: 4
162
148
  summary: OpenBSD's bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based PRF)