ktct 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95a1da6215d98401a8b9374f3771f99f54e498a7e66e3d77eceb4aa6d325a0bd
4
- data.tar.gz: 9daa6debac46407f51303273b4c4ff6e3692b104860964b2d58dd5fc4f4ae1dd
3
+ metadata.gz: 3768f0c109ba4cf491753cf513c6462961af507efe1db93967b5d6c4945120d3
4
+ data.tar.gz: b93266dfee9d2c5c7f2c6618569b2c8443eb56fb7335417c112748b956919135
5
5
  SHA512:
6
- metadata.gz: 5a9c7f806351c0e5072f7239945136cb390269427738b8de0b97ebd5fa95b564b1979d50509549b7fa5683655952ac1d8d3653fdcd0f0f60154600630480f102
7
- data.tar.gz: b2b6d3b97b907b0cea81009fbaf023497d6ee3148570f7f2393f3a31bb2379eb581fa478beae78487725d2b66a9a1e2595c154e0120700aba3f932da28acd349
6
+ metadata.gz: 76dbfc9743b61c862f1f9b74a4fe80d181972ff4151494737e72969d864daac8c7c7c213a2704086a5b947b581fcc09c42214805ef6db31f839692e12f4fece3
7
+ data.tar.gz: 296505cce41edf7b1e17c95c09ef5d9cf0ef838a586b8e2ae1a88d39b9fc219563b7f824ef8ea9983eaacd0e493a45896fca804bb6885d54fb6e5c1bcaa53d44
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ktct (0.1.0)
4
+ ktct (0.1.1)
5
5
  thor (~> 0.20.0)
6
6
 
7
7
  GEM
data/lib/ktct/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ktct
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -13,19 +13,19 @@ module Ktct
13
13
  desc 'encrypt [DATA]', "Encrypt data using Wangjinshe's public key, DATA can also be read from STDIN"
14
14
  def encrypt(data = nil)
15
15
  reset_key(config['server_public_key_path'])
16
- puts URI::encode_www_form_component(Base64.strict_encode64(public_encrypt(data || STDIN.read)))
16
+ puts URI::encode_www_form_component(Base64.strict_encode64(public_encrypt(data || STDIN.read)).scan(/.{1,76}/).join("\n"))
17
17
  end
18
18
 
19
19
  desc 'decrypt [DATA]', "Decrypt data using client's private key, DATA can also be read from STDIN"
20
20
  def decrypt(data = nil)
21
21
  reset_key(config['client_private_key_path'])
22
- puts private_decrypt(Base64.strict_decode64(data || STDIN.read))
22
+ puts private_decrypt(Base64.strict_decode64((data || STDIN.read).gsub(/\n/, '')))
23
23
  end
24
24
 
25
25
  desc 'sign [DATA]', "Sign data using client's private key, DATA can also be read from STDIN"
26
26
  def sign(data = nil)
27
27
  reset_key(config['client_private_key_path'])
28
- puts URI::encode_www_form_component(Base64.strict_encode64(key.sign('sha1', data || STDIN.read)))
28
+ puts URI::encode_www_form_component(Base64.strict_encode64(key.sign('sha1', data || STDIN.read)).scan(/.{1,76}/).join("\n"))
29
29
  end
30
30
 
31
31
  # desc 'verify <SIGNATURE> [DATA]', "Verify signature using Wangjinshe's public key, DATA can also be read from STDIN"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ktct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang