ncypher 0.6.0 → 0.6.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/.travis.yml +3 -1
- data/README.md +19 -10
- data/exe/ncypher +8 -2
- data/lib/ncypher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b65ff999987a0b7d414107d2910d0e00d5f206fd
|
4
|
+
data.tar.gz: c82bced9cc0630a9700162fda252abe17922fee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48e16e07449f59be41db2260df232003fd7d527dba43fca21972d8ed6716e4b7810813eb66a47c64b195820b90822f59351a304e90a3594510d2fec05fbf0b39
|
7
|
+
data.tar.gz: 7bf1a6aa712ab2c6425d5b240dc9ac344f071ad3b86dd79c1be9de083a7dd3eae0e0c00eddb6b85fb911244181a46b884e23ab6a12ab893fc6618379946ff27c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -30,19 +30,24 @@ $> ncypher generate_key > .ncypher_key
|
|
30
30
|
```
|
31
31
|
You can also set the env variable `NCYPHER_KEY` to that generated key (i.e `export NCYPHER_KEY=kSzARCAw9uv/LQ1o75k5ica1oCpZBUCpP99Sy+s6L2c=`) instead of saving it to a file
|
32
32
|
|
33
|
-
To encrypt a new password (or anything else):
|
33
|
+
To encrypt a new password (or anything else), ncypher supports stdin. So you can do:
|
34
34
|
```
|
35
|
-
$> ncypher encrypt
|
36
|
-
|
35
|
+
$> cat secret_file | ncypher encrypt > secret_file.encrypted
|
36
|
+
$> cat secret_file.encrypted | ncypher decrypt > secret_file
|
37
|
+
$> ncypher encrypt
|
38
|
+
mypassword
|
39
|
+
<CTRL+D>
|
40
|
+
TAmmvlinPFBmH9bx+IW9L5lKkRdgv3Yv3P4kyyIs0uTTyiTunG7vZ+DNVHMJiuviHOHg
|
37
41
|
```
|
42
|
+
I highly recommend you to always use that method! As passing the password as parameter will keep it in your shell history (unless you have HISTFILE=/dev/null).
|
43
|
+
|
44
|
+
If you want to do it by passing the pass as parameter:
|
38
45
|
|
39
|
-
Now you can directy put in your .yaml files:
|
40
46
|
```
|
41
|
-
|
42
|
-
|
47
|
+
$> ncypher encrypt 'p4$$w0rd'
|
48
|
+
deB7ba27qR470UetK/HW47dYMN7p9hguuDiVt59U+Bly6cfQcjgbw/ui/2hBhCEa
|
43
49
|
```
|
44
50
|
|
45
|
-
And Ncypher::Ncypher.decrypt will magically use your key in `.ncypher_key` to decrypt that password at runtime.
|
46
51
|
Note, you can also use the decrypt parameter in the ncypher binary to do the decryption:
|
47
52
|
```
|
48
53
|
$> ncypher decrypt deB7ba27qR470UetK/HW47dYMN7p9hguuDiVt59U+Bly6cfQcjgbw/ui/2hBhCEa
|
@@ -56,12 +61,16 @@ p4$$w0rd
|
|
56
61
|
|
57
62
|
:)
|
58
63
|
|
59
|
-
|
64
|
+
And Ncypher::Ncypher.decrypt will magically use your key in `.ncypher_key` to decrypt that password at runtime.
|
65
|
+
Now you can directy put in your .yaml files:
|
60
66
|
```
|
61
|
-
|
62
|
-
|
67
|
+
defaults: &defaults
|
68
|
+
my_password: <%= Ncypher::Ncypher.decrypt('lXEwfKv4dEjmK0kojEAnikNsLCsVCtSMiR2aSfM6uUXYn2DzCZ3O7SA9HaGnMp/kEEsI') %>
|
63
69
|
```
|
64
70
|
|
71
|
+
|
72
|
+
|
73
|
+
|
65
74
|
## Development
|
66
75
|
|
67
76
|
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.
|
data/exe/ncypher
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'ncypher'
|
3
3
|
|
4
|
+
begin
|
5
|
+
Object.const_get('Ncypher')
|
6
|
+
rescue NameError
|
7
|
+
require 'bundler/setup'
|
8
|
+
end
|
9
|
+
|
4
10
|
SUB_COMMANDS = %w(generate_key encrypt decrypt)
|
5
11
|
|
6
12
|
if ARGV.empty?
|
@@ -20,8 +26,8 @@ case cmd
|
|
20
26
|
puts Ncypher::Ncypher.new.key_b64
|
21
27
|
when "encrypt"
|
22
28
|
text = (ARGV.shift || STDIN.read)
|
23
|
-
puts Ncypher::Ncypher.new.encrypt(text)
|
29
|
+
puts Ncypher::Ncypher.new.encrypt(text.strip)
|
24
30
|
when "decrypt"
|
25
31
|
text = (ARGV.shift || STDIN.read)
|
26
|
-
puts Ncypher::Ncypher.new.decrypt(text)
|
32
|
+
puts Ncypher::Ncypher.new.decrypt(text.strip)
|
27
33
|
end
|
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: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Hagege
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|