nygma 0.2.0 → 0.2.1
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 +5 -4
- data/lib/nygma/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 360bf7fd24ac115b1511729bed1fda18111a7d62
|
|
4
|
+
data.tar.gz: 9f468da49fc728bc8dfe38fd02a36336f65902ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4df1922d6ff91a6256b670d21c67d0900b9a1f1768ae1fd6a2bf514ba8dd0bfcd545cd9b61c09a99da5f34abea043536e6528a169dc9d010542389075f614cdd
|
|
7
|
+
data.tar.gz: b9e1da0b50d9e5911159fb925e83128c28f58697ed528c07d649caa41c71edc9118ad241cd9bc1fd67381e1bc475ef5cf8dc290254e74666c770ef52c97c4424
|
data/README.md
CHANGED
|
@@ -14,12 +14,13 @@ Gotham's very own Mr. Nygma, a Rails 4.2 attribute Encryptor
|
|
|
14
14
|
Add Nygma to your Gemfile and an initialiser to your Rails app, generating the
|
|
15
15
|
key and salt with `SecureRandom.hex(40)` and `SecureRandom.random_bytes(64)`.
|
|
16
16
|
|
|
17
|
+
These are best passed to your app via env keys, as shown below.
|
|
18
|
+
|
|
17
19
|
```ruby
|
|
18
20
|
# config/initializers/nygma.rb
|
|
19
21
|
|
|
20
22
|
Rails.application.config.encryptor = Nygma::Encryptor.crypt!(
|
|
21
|
-
'
|
|
22
|
-
'[d\x89\r\xF6\xEB7\x9C\n\x1F+\xCAG\xF1g\e\x9Bg\xA7-:iG\b4\x03\xED\xCE\x8F>OH\b\x80\x8F\xE3\x17j\x1D\xA6\b?3\xC4\xE4\x8D\x9Eb\xA5\xB0\xB6jS\xAD\v\xE4\xBB\xDB\xF7\xFC\xBC\x04\xFD\xE4'
|
|
23
|
+
ENV['NYGMA_KEY'], ENV['NYGMA_SECRET']
|
|
23
24
|
)
|
|
24
25
|
```
|
|
25
26
|
|
|
@@ -40,8 +41,8 @@ persisted to disk.
|
|
|
40
41
|
|
|
41
42
|
```ruby
|
|
42
43
|
crypt = Nygma::Encryptor.crypt!(
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
SecureRandom.hex(40),
|
|
45
|
+
SecureRandom.random_bytes(64)
|
|
45
46
|
)
|
|
46
47
|
|
|
47
48
|
encrypted_data = crypt.encrypt("foo")
|
data/lib/nygma/version.rb
CHANGED