ncypher 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -6
- data/lib/ncypher.rb +5 -3
- data/lib/ncypher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f5677085002a6face9c3bd0fc903a133083a78ef690e960fc24c8386e8061b8
|
4
|
+
data.tar.gz: 3e834ad55b6e82f468a386b8bb1b882dff6867b45c0890ed1d232b9c7c82ada5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/ncypher.rb
CHANGED
@@ -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(
|
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.
|
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
|
|
data/lib/ncypher/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|