krypton 0.1.2 → 0.1.3

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
- SHA256:
3
- metadata.gz: 13cc16003ed6ba4cb33f16121c9eabebead852c86c4afce9a741f29e96c46a29
4
- data.tar.gz: ed4c40a2a268370f4671bd0ed38505814a23be8275050e58adc59f9b305a0045
2
+ SHA1:
3
+ metadata.gz: 1542eca097e78121c010021cc454b96c8c5ef1dd
4
+ data.tar.gz: 6ba468faba8c480f8df1080bc7a821b7f6f964c0
5
5
  SHA512:
6
- metadata.gz: 416a4f5be68dfdb227eb9b44183d3e2a4a43c6f9bd01ab39caf69308a76fefba31b073e16663242a4992310e68938f834a3a0d1c23f80c5fdfb82ca8579df9cb
7
- data.tar.gz: 502fe088cd81cc66cf8f66620bb0dbdf10a6cccef0164b6ad4fc2f7f88a3dfef835e6ffae4093f5306753a87cb5e19f11df4f05d57badf8a2cf1aad978ae1621
6
+ metadata.gz: 07111d7a9829ab029fc9298b50bfeff101429a1349f5fd34fcb9f9d81aa95520b57f4d7f6e595ecd174571a507bd2e91e14f7693bd9fbc190eb74de0f4715489
7
+ data.tar.gz: 7a815f2d34bb09ad9d5ec829a6db7f2e85a7757e1d8c4b7b7c9551e059497e28fb01b6124cc840d05a90557422103a8ffe7ba4649d7846d715a5cf4efdb40cd8
data/.gitignore CHANGED
@@ -3,9 +3,11 @@
3
3
  /_yardoc/
4
4
  /coverage/
5
5
  /doc/
6
- /pkg/
6
+ pkg
7
7
  /spec/reports/
8
8
  /tmp/
9
+ *.gem
10
+ .vscode
9
11
 
10
12
  # rspec failure tracking
11
13
  .rspec_status
data/.rspec CHANGED
File without changes
File without changes
File without changes
data/Gemfile CHANGED
File without changes
File without changes
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -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
- puts "#{ARGV[ARGV.length - 2] + ' => '}#{Paint[result.strip, '#2ecc71']}"
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
- puts "#{ARGV[ARGV.length - 2] + ' => '}#{Paint[result.strip, '#2ecc71']}"
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
- puts "#{ARGV[ARGV.length - 1] + ' => '}#{Paint[result.strip, '#2ecc71']}"
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
File without changes
File without changes
@@ -9,7 +9,6 @@ class AESCrypt
9
9
  a = Base64.encode64(self.encrypt_data(message.to_s.strip, self.key_digest(password), nil, "AES-256-CBC"))
10
10
  File.write(outfile, a) unless outfile == '' || outfile.nil?
11
11
  a
12
-
13
12
  end
14
13
 
15
14
  def self.decrypt(message, password, outfile='')
@@ -1,10 +1,9 @@
1
- VERSION = "0.1.2"
1
+ VERSION = "0.1.3"
2
2
  AUTHORS = {
3
3
  'Carter Brainerd' => '0xCB[at]protonmail[dot]com'
4
4
  }
5
5
 
6
6
  module Krypton
7
- module Constants
8
-
9
- end
7
+ module Constants
8
+ end
10
9
  end
File without changes
@@ -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['4B738DA7D58CEFFAC231EB949EF583CE9E5DC5BB9256C395E9B239009BD1A827', '#95a5a6']}
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.2
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-09-28 00:00:00.000000000 Z
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.7.3
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.