gibberish 1.3.0 → 1.3.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
  SHA1:
3
- metadata.gz: 615d0b35bad8161dd357fca6dbe11049f9efcbb4
4
- data.tar.gz: d9ab3a19076095e505785df668c4ad78305724e6
3
+ metadata.gz: 8c83983d7b49f4602074981db57d824c5192d1fd
4
+ data.tar.gz: 155562f750efe604ba2f5af4ae21c327705519cb
5
5
  SHA512:
6
- metadata.gz: 1ad21cb479d7d2252ee98dc1050a1f6d122a438aa9db60c4ed303980af1725f7687a938d22f0ee7aa790a42868a6dad5de000207f75c9a11988d9eff24d62d83
7
- data.tar.gz: 11b78f9beae9d119ec36d26ad8dec82de4a6cb90bd22e7db7538946813cee1128de79cdb1e4c3787403703cd6fbc577d8978e4200ceb0d4fb1951243ac13d99a
6
+ metadata.gz: 4eb9f30edb1073003b327918ad421229c63cc3fc8abc49f3f55e88b91f2d528fe56e472d69dbf3b7811cab109352e790bd09c26dd07785841996c7b601831e5e
7
+ data.tar.gz: ac672b666f806f45b85249983c247a19161641cb0abba0e57ec1b6405b7e014ec4e0896784799ff527c911c3fbcfc4ea04c46e5fabc126a8108d4fd9ee0641d2
@@ -1,3 +1,6 @@
1
+ ### v1.3.1
2
+ * Better errors [PR #14](https://github.com/mdp/gibberish/pull/14)
3
+
1
4
  ### v1.3.0
2
5
  * Add support for file encryption [PR #12](https://github.com/mdp/gibberish/pull/12)
3
6
  * Add support for streaming encryption [PR #11](https://github.com/mdp/gibberish/pull/11)
@@ -55,6 +55,7 @@ module Gibberish
55
55
  alias :e :encrypt
56
56
 
57
57
  def decrypt(data, opts={})
58
+ raise ArgumentError, 'Data is too short' unless data.length >= 16
58
59
  data = Base64.decode64(data) unless opts[:binary]
59
60
  salt = data[8..15]
60
61
  data = data[16..-1]
@@ -1,3 +1,3 @@
1
1
  module Gibberish
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -82,6 +82,10 @@ describe "the aes cipher" do
82
82
  FileUtils.cmp(source_file_path, decrypted_file.path).must_equal(true)
83
83
  end
84
84
 
85
+ it "should throw correct exception when decryption string is too short" do
86
+ assert_raises(ArgumentError) {@cipher.d("short")}
87
+ end
88
+
85
89
  describe 'stream encryption' do
86
90
 
87
91
  it 'encrypts a file' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibberish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-24 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Supports OpenSSL compatible AES, HMAC, and RSA encryption
14
14
  email: