encrypt 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 9a94e5efdc1e79b835acdff5b9743e3c208e13ca
4
- data.tar.gz: cda360aca0e6655502efbb005a8db0953d52ca69
3
+ metadata.gz: 5b19235367f67525fa9762a3d8ac24412940681b
4
+ data.tar.gz: c81a93aea5d4df6915691473be8cb0234bed2cb2
5
5
  SHA512:
6
- metadata.gz: 1f216b368a139c7664248e994576c81384697d9384b3bf8f9a049199da4561861162285b8802fd533caeeb4b80257213ec775e9b6a4f093b7fe82a280cb1a970
7
- data.tar.gz: 14ba9a4609255e5c4564349b9d86192f25ff321f2a7018dd24f2be6f4104d6e9ed47d4a49078697b1d38a62d83087a42624f76f42285261d68b5572ddd87a833
6
+ metadata.gz: 18c67e2f85158fab8883c90191a0dd01e8ba9052906c66dc45e49c41e521e1877088de91b6da607f747893141bce8938c152a516394d8774d20319f0e8cf882f
7
+ data.tar.gz: 1d58c450b06c03e55a9ab06d9423f9fd0bce76a0ccf43593f4f1ce9915e3513a275dbe737301ada17c06af83f7a3d670b5c9f26094076fc284e0719fbeaecb5f
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Encrypt
2
2
 
3
- Simply encrypt and decrypt strings with AES-256.
4
-
5
- Encrypt uses Ruby 2.0's experimental refinements to extend String locally to add the #encrypt and #decrypt methods. Activate the refinement with using: `using Encrypt`.
3
+ A gem for encrypting and decrypting strings with AES-256. Just supply the password.
6
4
 
7
5
  Encrypt uses an AES-256 cipher in CTR mode. A randomly generated salt and IV are publicly stored as the 32 bytes preceding the encrypted data.
8
6
 
7
+ Encrypt makes use of Ruby 2.0's experimental refinements to extend String locally, adding the #encrypt and #decrypt methods. Activate the refinement with using: `using Encrypt`.
8
+
9
9
  ## Usage
10
10
 
11
11
  ```ruby
@@ -13,11 +13,11 @@ require 'encrypt'
13
13
 
14
14
  using Encrypt
15
15
 
16
- encrypted = 'sekret msg'.encrypt 'passw0rd'
17
- #=> "\xFDB\xDF@b\xD0\xB8>\xFD\xFE"
16
+ encrypted = 'super sekret'.encrypt 'passw0rd'
17
+ #=> "\x13\xC4\x18\xE4\x1E.^HU0\rOZs\xFE7@\xC0\xB3\xB6\x9F\"\xE6M\xA6\xF4\xC4a\x85\x89\xECtW\xF9\x9DN\xA1_6\x8Bd\x0F\x19b"
18
18
 
19
19
  encrypted.decrypt 'passw0rd'
20
- #=> "sekret msg"
20
+ #=> "super sekret"
21
21
  ```
22
22
 
23
23
  ## Installation
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.version = Encrypt::VERSION
7
7
  spec.authors = ['Shannon Skipper']
8
8
  spec.email = ['shannonskipper@gmail.com']
9
- spec.description = %q{A gem for encrypting and decrypting a String with AES-256. Just supply the password.}
10
- spec.summary = %q{Encrypts and decrypts strings with AES-256 in CTR mode. Encrypt uses Ruby 2.0's experimental refinements to extend String locally to add the #encrypt and #decrypt methods.}
9
+ spec.description = %q{A gem for encrypting and decrypting strings with AES-256. Just supply the password.}
10
+ spec.summary = %q{Encrypt and decrypt strings with AES-256 in CTR mode. Encrypt uses Ruby 2.0's experimental refinements to extend String locally to add the #encrypt and #decrypt methods.}
11
11
  spec.homepage = 'https://github.com/havenwood/encrypt#readme'
12
12
  spec.license = 'MIT'
13
13
  spec.files = `git ls-files`.split($/)
@@ -12,6 +12,7 @@ module Encrypt
12
12
  end
13
13
 
14
14
  def decrypt key
15
+ return nil unless self.bytesize > 32
15
16
  cipher = OpenSSL::Cipher::AES256.new(:CTR)
16
17
  cipher.decrypt
17
18
  salt = self.byteslice(0..15)
@@ -1,3 +1,3 @@
1
1
  module Encrypt
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shannon Skipper
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: A gem for encrypting and decrypting a String with AES-256. Just supply
41
+ description: A gem for encrypting and decrypting strings with AES-256. Just supply
42
42
  the password.
43
43
  email:
44
44
  - shannonskipper@gmail.com
@@ -78,7 +78,7 @@ rubyforge_project:
78
78
  rubygems_version: 2.0.4
79
79
  signing_key:
80
80
  specification_version: 4
81
- summary: 'Encrypts and decrypts strings with AES-256 in CTR mode. Encrypt uses Ruby
81
+ summary: 'Encrypt and decrypt strings with AES-256 in CTR mode. Encrypt uses Ruby
82
82
  2.0''s experimental refinements to extend String locally to add the #encrypt and
83
83
  #decrypt methods.'
84
84
  test_files: