ncypher 0.6.0 → 0.6.1

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: 6c9b9a1e596c95f752611a13bac4579f743b8275
4
- data.tar.gz: 7e3700161dde7dd891146e014c9a785ed5830ea6
3
+ metadata.gz: b65ff999987a0b7d414107d2910d0e00d5f206fd
4
+ data.tar.gz: c82bced9cc0630a9700162fda252abe17922fee3
5
5
  SHA512:
6
- metadata.gz: e829c4e976f81855f17b5776b7e2a6b7b78b136d6c35f247e7bf41c362e8994e8e6b44b0bd2806ab0db842aaeb6b44c985ee954eb35dbd5337c017fb09780eef
7
- data.tar.gz: e0ded75c35de3557e0168e5c6a617cefd2ed30b5fe3ed03d5eefbef6d58061aa1417bc20bd6b2e86e94dfd0002c8690aa4c0a2503b54913ed90c24c6d9e06981
6
+ metadata.gz: 48e16e07449f59be41db2260df232003fd7d527dba43fca21972d8ed6716e4b7810813eb66a47c64b195820b90822f59351a304e90a3594510d2fec05fbf0b39
7
+ data.tar.gz: 7bf1a6aa712ab2c6425d5b240dc9ac344f071ad3b86dd79c1be9de083a7dd3eae0e0c00eddb6b85fb911244181a46b884e23ab6a12ab893fc6618379946ff27c
@@ -1,9 +1,11 @@
1
1
  sudo: false
2
+ cache:
3
+ bundler: true
2
4
  language: ruby
3
5
  rvm:
4
6
  - 2.2.1
5
7
  before_install: gem install bundler -v 1.12.5
6
- script: rake
8
+ script: bundle exec rake
7
9
  deploy:
8
10
  provider: rubygems
9
11
  api_key:
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 'p4$$w0rd'
36
- deB7ba27qR470UetK/HW47dYMN7p9hguuDiVt59U+Bly6cfQcjgbw/ui/2hBhCEa
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
- defaults: &defaults
42
- my_password: <%= Ncypher::Ncypher.decrypt('lXEwfKv4dEjmK0kojEAnikNsLCsVCtSMiR2aSfM6uUXYn2DzCZ3O7SA9HaGnMp/kEEsI') %>
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
- ncypher also supports stdin. So you can do
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
- $> cat secret_file | ncypher encrypt > secret_file.encrypted
62
- $> cat secret_file.encrypted | ncypher decrypt > secret_file
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.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ncypher
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
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: 0.6.0
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-16 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler