bcrypt_pbkdf 1.0.0-x64-mingw32 → 1.0.1-x64-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: 0b57505bd496a5217b20bd7f7b869bb9253591fc
4
- data.tar.gz: f19d53707b3f8d055227ae93215a19c1f31b1217
3
+ metadata.gz: 85160261ec87f3956362d07efae594eb10f2e6f2
4
+ data.tar.gz: 48b933dba75b5da8117acc4e5116af3bf00902f6
5
5
  SHA512:
6
- metadata.gz: a073176b163c9bfd17d29eb2c29d695a1eb5ec7785d353f5e649754ace51826153062a1e7dfc7db0b81858911c8502e926e0d470ddbf59963105d472d37c3e24
7
- data.tar.gz: 20823d9a7bbbf1666141a6f04c5c97337a7c65242ed3c7d74f3c2fb4c7bfaf86f7f79083703dc46359b8acce180265a69cd873888e3046b18614d6c1c644083e
6
+ metadata.gz: fcabd199e67fe8b75f977f0eea45be741f4487e9b77f1977e0b57e222ed7b3ba9467048ef9e2641a440bf32f0df2f5af8e55bb05a745c434284c5256be7cd29e
7
+ data.tar.gz: 41e9ce71bdfed07ad40d567ed5b40b98be83773724fd86bb0a75752f9c787874a7e193ae9263f7c1939dd83fa5a7909e75ff4feee0f5091f4fa8326a9838cecc
@@ -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: x64-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