ssbx 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: 0cda81615e31774e4279c4454b0a5b1c9d77bc331568acc612471f7f56dbc586
4
- data.tar.gz: e5d8453d32656c2018cbc83208701952b9a96b9e3d058689dd2948d295a0f426
3
+ metadata.gz: fb3f97e7f7bcd6aced71f70fca0c43ebec72d0e4251b003e447a87d49eacb039
4
+ data.tar.gz: ecc265a10d0045c6f07944b7379432b7bf2452a77b2ca9893b1d6acb5f0d4424
5
5
  SHA512:
6
- metadata.gz: 496d3f33a15db8e5ad3080a2651ffb1b25f40d631add12a58ae4365196dffb9936bb71d03ea3e462757b35a17a9e4e11031b4cfb7f15914981879fd78d0e77e6
7
- data.tar.gz: bf54c85290eeb62e4ab9e4bb3e230a783fbe168ac76756dbbdfdc2f61a8b6277c67cab970ffb67c19ef66875c63987cea54c7225ccba5ea3894ec4abecbb5475
6
+ metadata.gz: df6183075ea93db79bd41942085cfd45b18a807cf17f198d0c7071d92a79f7098288d5e08c9a2c2fed48f73ae995e986b85acecf6850a49b22fe7426b37b4022
7
+ data.tar.gz: 3e68060e935524cc38184c5e63c6e48ef19b909e86ba0fd2314d43e52e6c34b8dbaaebaf8c5cde76f1cd3c630f25394f4931d25079da365a33625c41a46426b5
data/README.md CHANGED
@@ -25,7 +25,7 @@ user: You
25
25
  pass: A secret password
26
26
  ```
27
27
 
28
- Then use `ssbx` to view or edit that file.
28
+ Then use `ssbx` to view or edit a file.
29
29
 
30
30
  ## Development
31
31
 
data/lib/ssbx/box.rb CHANGED
@@ -8,6 +8,9 @@ module Ssbx
8
8
  # This uses File to read and write data, but the actual encryption logic is in here.
9
9
  class Box
10
10
 
11
+ # The symetric cipher name used for the symetric parts of this algorithm.
12
+ SYMETRIC_CIPHER_NAME = 'AES-256-CBC'
13
+
11
14
  # Create a new box.
12
15
  def initialize(file)
13
16
  if file.is_a? IO
@@ -30,7 +33,7 @@ module Ssbx
30
33
  privkey = OpenSSL::PKey::RSA.new(2048)
31
34
 
32
35
  userrecord = [ userid ]
33
- userrecord << privkey.to_pem(OpenSSL::Cipher::AES.new('128-CBC'), password)
36
+ userrecord << privkey.to_pem(OpenSSL::Cipher.new(SYMETRIC_CIPHER_NAME), password)
34
37
  userrecord << privkey.public_key.to_pem
35
38
  userrecord << '' # Private Key
36
39
  userrecord << '' # Initialization Vector.
@@ -42,14 +45,14 @@ module Ssbx
42
45
  privkey = OpenSSL::PKey::RSA.new(2048)
43
46
 
44
47
  # Rotate user record entries.
45
- userrecord[1] = privkey.to_pem(OpenSSL::Cipher::AES.new('128-CBC'), password)
48
+ userrecord[1] = privkey.to_pem(OpenSSL::Cipher.new(SYMETRIC_CIPHER_NAME), password)
46
49
  userrecord[2] = privkey.public_key.to_pem
47
50
  userrecord[3] = '' # Private Key
48
51
  userrecord[4] = '' # Initialization Vector.
49
52
  end
50
53
 
51
54
  # Make semetric cipher.
52
- cipher = OpenSSL::Cipher.new('AES-256-CBC')
55
+ cipher = OpenSSL::Cipher.new(SYMETRIC_CIPHER_NAME)
53
56
  cipher.encrypt
54
57
 
55
58
  key = cipher.random_key
@@ -85,7 +88,7 @@ module Ssbx
85
88
 
86
89
  privkey = OpenSSL::PKey::RSA.new(userrecord[1], password)
87
90
 
88
- cipher = OpenSSL::Cipher.new('AES-256-CBC')
91
+ cipher = OpenSSL::Cipher.new(SYMETRIC_CIPHER_NAME)
89
92
  cipher.decrypt
90
93
 
91
94
  cipher.key = privkey.private_decrypt(userrecord[3])
data/lib/ssbx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ssbx
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssbx
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
  - Sam
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubyforge_project:
87
- rubygems_version: 2.7.6
86
+ rubygems_version: 3.0.1
88
87
  signing_key:
89
88
  specification_version: 4
90
89
  summary: Shared encrypted file.