krypton 0.1.2 → 0.1.3
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 +5 -5
- data/.gitignore +3 -1
- data/.rspec +0 -0
- data/.travis.yml +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/console +0 -0
- data/bin/krypton +19 -3
- data/bin/setup +0 -0
- data/krypton.gemspec +0 -0
- data/lib/core.rb +0 -0
- data/lib/core/aes.rb +0 -1
- data/lib/core/constants.rb +3 -4
- data/lib/core/sha.rb +0 -0
- data/lib/core/text.rb +1 -1
- data/scripts/release_and_build.sh +34 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1542eca097e78121c010021cc454b96c8c5ef1dd
|
4
|
+
data.tar.gz: 6ba468faba8c480f8df1080bc7a821b7f6f964c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07111d7a9829ab029fc9298b50bfeff101429a1349f5fd34fcb9f9d81aa95520b57f4d7f6e595ecd174571a507bd2e91e14f7693bd9fbc190eb74de0f4715489
|
7
|
+
data.tar.gz: 7a815f2d34bb09ad9d5ec829a6db7f2e85a7757e1d8c4b7b7c9551e059497e28fb01b6124cc840d05a90557422103a8ffe7ba4649d7846d715a5cf4efdb40cd8
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bin/console
CHANGED
File without changes
|
data/bin/krypton
CHANGED
@@ -16,6 +16,10 @@ OptionParser.new do |opts|
|
|
16
16
|
opts.banner = "A command-line tool to encrypt and decrypt data in multiple formats.\n\nUsage: #{File.basename($PROGRAM_NAME)} [options] [task] \"message\" \"key\"\nKrypton version: #{Paint[VERSION, '#2ecc71']}"
|
17
17
|
opts.separator Paint["\nGlobal Options: ", '#95a5a6']
|
18
18
|
|
19
|
+
opts.on('-s', '--std', 'Print output suitable for piping.') do
|
20
|
+
options[:std] = true
|
21
|
+
end
|
22
|
+
|
19
23
|
opts.on('-o OUTFILE', '--outfile OUTFILE', String, 'A file to save the output in') do |v|
|
20
24
|
options[:outfile] = v
|
21
25
|
end
|
@@ -48,16 +52,28 @@ while (opt = ARGV.shift) do
|
|
48
52
|
when 'encrypt'
|
49
53
|
#puts Krypton::AESCrypt.encrypt(ARGV[ARGV.length - 2], ARGV[ARGV.length - 1], options[:outfile]) if options[:raw]
|
50
54
|
result = Base64.encode64(Krypton::AESCrypt.encrypt(ARGV[ARGV.length - 2], ARGV[ARGV.length - 1], options[:outfile]))
|
51
|
-
|
55
|
+
if options[:std]
|
56
|
+
puts result.strip
|
57
|
+
else
|
58
|
+
puts "#{ARGV[ARGV.length - 2] + ' => '}#{Paint[result.strip, '#2ecc71']}"
|
59
|
+
end
|
52
60
|
exit 0
|
53
61
|
when 'decrypt'
|
54
62
|
#puts Krypton::AESCrypt.decrypt(ARGV[ARGV.length - 2], ARGV[ARGV.length - 1], options[:outfile]) if options[:raw]
|
55
63
|
result = Krypton::AESCrypt.decrypt(Base64.decode64(ARGV[ARGV.length - 2]), ARGV[ARGV.length - 1], options[:outfile])
|
56
|
-
|
64
|
+
if options[:std]
|
65
|
+
puts result.strip
|
66
|
+
else
|
67
|
+
puts "#{ARGV[ARGV.length - 2] + ' => '}#{Paint[result.strip, '#2ecc71']}"
|
68
|
+
end
|
57
69
|
exit 0
|
58
70
|
when 'hash'
|
59
71
|
result = Krypton::SHA.hash(ARGV[ARGV.length - 1], options[:raw])
|
60
|
-
|
72
|
+
if options[:std]
|
73
|
+
puts result.strip
|
74
|
+
else
|
75
|
+
puts "#{ARGV[ARGV.length - 1] + ' => '}#{Paint[result.strip, '#2ecc71']}"
|
76
|
+
end
|
61
77
|
exit 0
|
62
78
|
else
|
63
79
|
puts "#{opt} is not a valid action!"
|
data/bin/setup
CHANGED
File without changes
|
data/krypton.gemspec
CHANGED
File without changes
|
data/lib/core.rb
CHANGED
File without changes
|
data/lib/core/aes.rb
CHANGED
data/lib/core/constants.rb
CHANGED
data/lib/core/sha.rb
CHANGED
File without changes
|
data/lib/core/text.rb
CHANGED
@@ -10,5 +10,5 @@ TASKS_HELP =
|
|
10
10
|
|
11
11
|
#{Paint['Examples', '#95a5a6']}
|
12
12
|
#{Paint['$ krypton encrypt "mymessage" "mykey"', '#2ecc71']} #{Paint['=> ckhJWXcyTE1leENLOWpBQzJWbElMdz09Cg==', '#95a5a6']}
|
13
|
-
#{Paint['$ krypton hash "mymessage"', '#2ecc71']} => #{Paint['
|
13
|
+
#{Paint['$ krypton hash "mymessage"', '#2ecc71']} => #{Paint['S3ONp9WM7/rCMeuUnvWDzp5dxbuSVsOV6bI5AJvRqCc=', '#95a5a6']}
|
14
14
|
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
cd ..
|
4
|
+
|
5
|
+
CURRENT_VERSION=$(cat lib/core/constants.rb | grep VERSION | cut -d '"' -f 2)
|
6
|
+
|
7
|
+
TO_UPDATE=(
|
8
|
+
lib/core/constants.rb
|
9
|
+
)
|
10
|
+
|
11
|
+
echo -n "Current version is $CURRENT_VERSION, select new version:"
|
12
|
+
read NEW_VERSION
|
13
|
+
echo "Creating v$NEW_VERSION...\n"
|
14
|
+
|
15
|
+
for file in "${TO_UPDATE[@]}"
|
16
|
+
do
|
17
|
+
echo "Patching $file ..."
|
18
|
+
sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g" $file
|
19
|
+
git add $file
|
20
|
+
done
|
21
|
+
|
22
|
+
|
23
|
+
git commit -m "Releasing v$NEW_VERSION"
|
24
|
+
git push
|
25
|
+
|
26
|
+
git tag -a v$NEW_VERSION -m "Release v$NEW_VERSION"
|
27
|
+
git push origin v$NEW_VERSION
|
28
|
+
|
29
|
+
echo
|
30
|
+
echo "Version $NEW_VERSION pushed to GitHub. Building gem and pushing to RubyGems now..."
|
31
|
+
|
32
|
+
gem build krypton.gemspec
|
33
|
+
|
34
|
+
gem push krypton-$NEW_VERSION.gem
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: krypton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cbrnrd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/core/constants.rb
|
135
135
|
- lib/core/sha.rb
|
136
136
|
- lib/core/text.rb
|
137
|
+
- scripts/release_and_build.sh
|
137
138
|
homepage: https://github.com/cbrnrd/krypton
|
138
139
|
licenses:
|
139
140
|
- MIT
|
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
155
|
version: '0'
|
155
156
|
requirements: []
|
156
157
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.6.13
|
158
159
|
signing_key:
|
159
160
|
specification_version: 4
|
160
161
|
summary: A command-line tool for easy encryption and decryption of data.
|