ncypher 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: 989b6d44b589e9fa71ec5137276c09867b2d4d482407159760c95cd50a3c6716
4
- data.tar.gz: e4d7e40704a9cdd217e9082fd9b4cd53931e45636dc592606924060bc6cdab08
3
+ metadata.gz: 4f5677085002a6face9c3bd0fc903a133083a78ef690e960fc24c8386e8061b8
4
+ data.tar.gz: 3e834ad55b6e82f468a386b8bb1b882dff6867b45c0890ed1d232b9c7c82ada5
5
5
  SHA512:
6
- metadata.gz: c2b9b6febacf7f908aa82e5e3282106789bb508794bfbe686861831dae0b5fe6f9fa99ff334972e41b57ba82085380c32354186f24502d7f375b949ca233933e
7
- data.tar.gz: 9622331e0a1fe0671d982d65598ab666d221098cd62c212e1205bb21707351a5997fd2fea135c77a8462422bc908d24cd423d81a272d8a52ec12c7c86b606f8c
6
+ metadata.gz: 9ac7263205dc795be80d00b3f6afc8e61bd27fb184b06adf041e9d11e79a789a25c15d803c8e1dcb351a32a797b41858893a338be66eb55ce8cff02f68c0a094
7
+ data.tar.gz: c33dded92dd324931b7d945c27473065687a1009a584db95fa4b7c79aaf77eb8f33e8429dc2f8a17c446d3d9203d73a2c69c093d41eb77f99b935736ddb863b5
data/README.md CHANGED
@@ -97,12 +97,6 @@ SALT: WKCAkJcS65nx3lA/w1BmBw==
97
97
  Then you have the ncypher\_key in .ncypher\_key. Be sure to save the salt if you want to be able to derive back the exact same key in the future.
98
98
 
99
99
 
100
- ## Development
101
-
102
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
103
-
104
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
105
-
106
100
  ## Contributing
107
101
 
108
102
  Bug reports and pull requests are welcome on GitHub at https://github.com/pcboy/ncypher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -25,14 +25,16 @@ module Ncypher
25
25
  end
26
26
 
27
27
  def derive_key(password, encoded_salt = nil)
28
+ salt_size = 16 # RbNaCl::PasswordHash::Argon2::SALTBYTES
28
29
  salt ||= encoded_salt ?
29
30
  Base64.strict_decode64(encoded_salt) :
30
- RbNaCl::Random.random_bytes(RbNaCl::PasswordHash::Argon2::SALTBYTES)
31
+ RbNaCl::Random.random_bytes(salt_size)
31
32
 
32
33
  opslimit = 5
33
34
  memlimit = 7_256_678
34
- digest_size = RbNaCl::SecretBox.key_bytes
35
- generated_key = RbNaCl::PasswordHash.argon2(password, salt, opslimit, memlimit, digest_size)
35
+ digest_size = 32 # RbNaCl::SecretBox.key_bytes
36
+ generated_key = RbNaCl::PasswordHash::Argon2.new(opslimit, memlimit, digest_size)
37
+ .digest(password, salt, :argon2i)
36
38
  [Base64.strict_encode64(generated_key), Base64.strict_encode64(salt)]
37
39
  end
38
40
 
@@ -1,3 +1,3 @@
1
1
  module Ncypher
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncypher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Hagege
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-06 00:00:00.000000000 Z
11
+ date: 2020-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler