reversible_cryptography 0.4.0 → 0.5.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 +11 -0
- data/lib/reversible_cryptography/cli.rb +22 -0
- data/lib/reversible_cryptography/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cf705c97fa1a7cadab65c8e9284cadfbff63752
|
4
|
+
data.tar.gz: 58a7ecb70dee65625fa853a56ec18deb0405332b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e1dadffd3a182f6ae8f1264fb4b4b4a021ccaf362b9a148c64eff2363994e7949e2bcdcbe86a940dc41283ffc447b460bbf617922ec4b9a2bdfbfb67df507a
|
7
|
+
data.tar.gz: d3bf71b3e13cbea75222ec3b6adbc5dafd752c44d6eaba9253d5847b0a48a9a0cb25eef963808342831dede33f708f317a2d624f2df6da25784083312e825e91
|
data/README.md
CHANGED
@@ -35,6 +35,7 @@ $ reversible_cryptography
|
|
35
35
|
|
36
36
|
Commands:
|
37
37
|
reversible_cryptography decrypt [TEXT] # Decrypt text or file
|
38
|
+
reversible_cryptography edit FILE # Edit encrypted file
|
38
39
|
reversible_cryptography encrypt [TEXT] # Encrypt text or file
|
39
40
|
reversible_cryptography help [COMMAND] # Describe available commands or one specific command
|
40
41
|
```
|
@@ -75,6 +76,16 @@ cat decrypted.txt
|
|
75
76
|
this is secret!
|
76
77
|
```
|
77
78
|
|
79
|
+
#### Edit sample
|
80
|
+
```shell
|
81
|
+
cat encrypted.txt
|
82
|
+
md5:f5b013aca1b774be3d3b5f09f76e6cc8:salt:228-129-190-248-134-146-102-97:aes-256-cfb:u+lhtAdW6Re8br0qePqzig==
|
83
|
+
|
84
|
+
reversible_cryptography edit encrypted.txt --password=pass --editor=vim
|
85
|
+
|
86
|
+
# modify encrypted.txt
|
87
|
+
```
|
88
|
+
|
78
89
|
## Development
|
79
90
|
|
80
91
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -42,5 +42,27 @@ module ReversibleCryptography
|
|
42
42
|
puts plain_text
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
desc "edit FILE", "Edit encrypted file"
|
47
|
+
option :password, type: :string, aliases: [:p]
|
48
|
+
option :editor, type: :string, aliases: [:e]
|
49
|
+
def edit(encrypted_file)
|
50
|
+
password = options[:password]
|
51
|
+
password ||= ask("Input password:", echo: false).tap { puts }
|
52
|
+
editor_command = options[:editor] || ENV['EDITOR']
|
53
|
+
|
54
|
+
Tempfile.open('decrypted_text') do |fp|
|
55
|
+
decrypted_text = ReversibleCryptography::Message.decrypt(File.read(encrypted_file), password)
|
56
|
+
fp.write(decrypted_text)
|
57
|
+
fp.close
|
58
|
+
|
59
|
+
system("#{editor_command} #{fp.path}")
|
60
|
+
encrypted_text = ReversibleCryptography::Message.encrypt(File.read(fp.path), password)
|
61
|
+
|
62
|
+
File.open(encrypted_file, "wb") do |f|
|
63
|
+
f.write(encrypted_text)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
45
67
|
end
|
46
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reversible_cryptography
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takumi MIURA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.5.1
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: A Símplifìed reversible encryption solution
|