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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16eed1c1b99fab1e95db321fa2b6cdce9a0602bd
4
- data.tar.gz: 976d749b43feedf1db6e495a835680f47a7f7dd9
3
+ metadata.gz: 3a4ad32f7c5a9bf18606c1557967b22aa6817ff5
4
+ data.tar.gz: 44a0bc3f4df2b56f1c4995275a88846895158b9b
5
5
  SHA512:
6
- metadata.gz: 81b4f0784faa018e01984f9bf54ea01693e82940df35cff3bd364f26d9ba66d044017f1e35d2fc41202096ef4fce4fb521578bdaec1839f34991d7e5dc456a90
7
- data.tar.gz: bfafe9cf03d51d9784879f2983e9ed1defa04103e17aa534fcb20128c2054a2547e66ec722ec17885c8dae26c77df05195ddfcd8a3ed0a91bc8eb1e0be4f24e4
6
+ metadata.gz: f56634799d85662e6906011ff911b1b338ff0484c8621e3f4d6067b5d13cda2cfd9089f0eda861ecaf88fafc69057595253836e9553e0ade65b6acdae74aa5c6
7
+ data.tar.gz: 4af105808a3b198f20ec5e2e1e976395007e244b554fbfb0fc9e2900c006922268643a161d8608d6fa96bbefec932935fabf0dad67d5a51e2c9a59359a671552
@@ -1,3 +1,3 @@
1
1
  # 1.0.0.apha1
2
2
 
3
- inital version
3
+ initial version
@@ -1,22 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bcrypt_pbkdf (1.0.0)
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.13.6
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
+ ```
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'bcrypt_pbkdf'
3
- s.version = '1.0.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 '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
 
@@ -6,7 +6,7 @@
6
6
  #include <stdlib.h>
7
7
  #include <strings.h>
8
8
 
9
- #if defined(_WIN32)
9
+ #if defined(_WIN32) || (defined(__sun) && defined(__SVR4))
10
10
 
11
11
  typedef uint8_t u_int8_t;
12
12
  typedef uint16_t u_int16_t;
Binary file
Binary file
Binary file
Binary file
@@ -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.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: 2016-11-25 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