gibberish 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitmodules CHANGED
@@ -1,3 +0,0 @@
1
- [submodule "doc"]
2
- path = doc
3
- url = git@github.com:mdp/gibberish.git
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.8.7
5
+ - ree
data/CHANGELOG.mdown CHANGED
@@ -1,3 +1,6 @@
1
+ ### v1.2.2
2
+ * Added support for EBC mode on AES [PR #10](https://github.com/mdp/gibberish/pull/10)
3
+
1
4
  ### v1.2.1
2
5
  * Added support for an optional salt - PR mdp/gibberish#9
3
6
  * Adding gem signing
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source "http://rubygems.org"
2
2
  gemspec
3
3
  gem 'minitest'
4
4
  gem 'mini_shoulda'
5
+ gem 'rake'
data/README.markdown CHANGED
@@ -1,4 +1,5 @@
1
1
  # Gibberish - Encryption in Ruby made simple
2
+ ![Travis](https://secure.travis-ci.org/mdp/gibberish.png)
2
3
 
3
4
  ### What
4
5
  Gibberish is an opinionated cryptography library for Ruby. Its objective is easy but secure
data/Rakefile CHANGED
@@ -9,3 +9,4 @@ task :spec do
9
9
  end
10
10
 
11
11
  task :test => :spec
12
+ task :default => [:test]
data/gibberish.gemspec CHANGED
@@ -14,10 +14,6 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "gibberish"
16
16
 
17
- # Gem Signing
18
- s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem")
19
- s.cert_chain = ["gem-public_cert.pem"]
20
-
21
17
  s.files = `git ls-files`.split("\n")
22
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
data/lib/gibberish/aes.rb CHANGED
@@ -31,10 +31,12 @@ module Gibberish
31
31
  #
32
32
  # @param [String] password
33
33
  # @param [Integer] size
34
- def initialize(password, size=256)
34
+ # @param [String] mode
35
+ def initialize(password, size=256, mode="cbc")
35
36
  @password = password
36
37
  @size = size
37
- @cipher = OpenSSL::Cipher::Cipher.new("aes-#{size}-cbc")
38
+ @mode = mode
39
+ @cipher = OpenSSL::Cipher::Cipher.new("aes-#{size}-#{mode}")
38
40
  end
39
41
 
40
42
  def encrypt(data, opts={})
@@ -1,3 +1,3 @@
1
1
  module Gibberish
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
data/spec/hmac_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe "HMAC" do
8
8
 
9
9
  it "should work with OpenSSL HMAC" do
10
10
  hmac = Gibberish::HMAC("password", "data\n")
11
- o_hmac = `echo "data" | openssl dgst -sha1 -hmac 'password'`
11
+ o_hmac = `echo "data" | openssl dgst -sha1 -hmac 'password' | sed 's/^.*= //'`
12
12
  hmac.must_equal(o_hmac.chomp)
13
13
  end
14
14
 
@@ -19,7 +19,7 @@ describe "HMAC" do
19
19
 
20
20
  it "should work with OpenSSL HMAC for sha224" do
21
21
  hmac = Gibberish::HMAC("password", "data\n", :digest => :sha224)
22
- o_hmac = `echo "data" | openssl dgst -sha224 -hmac 'password'`
22
+ o_hmac = `echo "data" | openssl dgst -sha224 -hmac 'password' | sed 's/^.*= //'`
23
23
  hmac.must_equal(o_hmac.chomp)
24
24
  end
25
25
 
@@ -30,7 +30,7 @@ describe "HMAC" do
30
30
 
31
31
  it "should work with OpenSSL HMAC for sha256" do
32
32
  hmac = Gibberish::HMAC("password", "data\n", :digest => :sha256)
33
- o_hmac = `echo "data" | openssl dgst -sha256 -hmac 'password'`
33
+ o_hmac = `echo "data" | openssl dgst -sha256 -hmac 'password' | sed 's/^.*= //'`
34
34
  hmac.must_equal(o_hmac.chomp)
35
35
  end
36
36
 
@@ -41,7 +41,7 @@ describe "HMAC" do
41
41
 
42
42
  it "should work with OpenSSL HMAC for sha384" do
43
43
  hmac = Gibberish::HMAC("password", "data\n", :digest => :sha384)
44
- o_hmac = `echo "data" | openssl dgst -sha384 -hmac 'password'`
44
+ o_hmac = `echo "data" | openssl dgst -sha384 -hmac 'password' | sed 's/^.*= //'`
45
45
  hmac.must_equal(o_hmac.chomp)
46
46
  end
47
47
 
@@ -51,7 +51,7 @@ describe "HMAC" do
51
51
 
52
52
  it "should work with OpenSSL HMAC for sha512" do
53
53
  hmac = Gibberish::HMAC("password", "data\n", :digest => :sha512)
54
- o_hmac = `echo "data" | openssl dgst -sha512 -hmac 'password'`
54
+ o_hmac = `echo "data" | openssl dgst -sha512 -hmac 'password' | sed 's/^.*= //'`
55
55
  hmac.must_equal(o_hmac.chomp)
56
56
  end
57
57
 
metadata CHANGED
@@ -1,54 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibberish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mark Percival
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain:
12
- - ! '-----BEGIN CERTIFICATE-----
13
-
14
- MIIDHjCCAgagAwIBAgIBADANBgkqhkiG9w0BAQUFADA1MQowCAYDVQQDDAFtMRMw
15
-
16
- EQYKCZImiZPyLGQBGRYDbWRwMRIwEAYKCZImiZPyLGQBGRYCaW0wHhcNMTMwMjEx
17
-
18
- MTYwNjAxWhcNMTQwMjExMTYwNjAxWjA1MQowCAYDVQQDDAFtMRMwEQYKCZImiZPy
19
-
20
- LGQBGRYDbWRwMRIwEAYKCZImiZPyLGQBGRYCaW0wggEiMA0GCSqGSIb3DQEBAQUA
21
-
22
- A4IBDwAwggEKAoIBAQCsyb70vRSb3hfN5Go04jz84/XRf68uJD9NeNyE0y+lylOY
23
-
24
- jWEMaLu9TE2kYKOAvyZ/9+ioK19P+se1jCTIM+PZ11bz4Wmgk23XqmuSjA6v1dEA
25
-
26
- rlmsudYmlW36VviSIdTN3rvwoSiB+XXiUujF97nhvjxBpxnc1hJkxRz4KYwjjUPd
27
-
28
- NiGxK2GULOVwEEk5BScIG+FFJd/NKHF8tkxiiZNyjZDIwTvqMhYpnr/VRX+EsCkr
29
-
30
- A9j1a1GRyAHSUtxWuqjpWaXff2CEg5JavLZk1P74Zxx0c+rpsvY+bD0w9bMyNdgu
31
-
32
- jxxRo0Ompt3sCfpPwdp1hTBHJycrsdfH9rscQ7SPAgMBAAGjOTA3MAkGA1UdEwQC
33
-
34
- MAAwHQYDVR0OBBYEFLqZ2ITNwA6y/W8sBBWIUECnr5KjMAsGA1UdDwQEAwIEsDAN
35
-
36
- BgkqhkiG9w0BAQUFAAOCAQEAWRYRvVRJadDNC5zUEakTzrxb45Ket7dkTn8ejvHK
37
-
38
- nYtr9rjtreDjUrXSrQ9rThIMvcmMixyflSF93n5cqWYPFkU0V0p7s8K6b0vmRk6d
39
-
40
- iALE8XKqQKqzQSxk4r9FZeM/hk1FC2WBwjuNEy5tcpLF4KERVJzYq54mIyWDUV5c
41
-
42
- VJKW8u5/Wu2D4LNNIkwkhh2ULYOA6UBVwMrjp0ZHpV7jrt8SIyl1c7ONhnY0Pxey
43
-
44
- mxtia3OcUaHjfnuLeQqK7YpQCM2f/8sur+kpDjXH0DYTjmlOvZ07JI0Isd7zobrL
45
-
46
- 2NEhdVRiMlG7L/ncFwqpHzWFY0r37QIQ9UwO5+t6lC9Cfg==
47
-
48
- -----END CERTIFICATE-----
49
-
50
- '
51
- date: 2013-02-11 00:00:00.000000000 Z
11
+ cert_chain: []
12
+ date: 2013-03-13 00:00:00.000000000 Z
52
13
  dependencies: []
53
14
  description: Supports OpenSSL compatible AES, HMAC, and RSA encryption
54
15
  email:
@@ -59,6 +20,7 @@ extra_rdoc_files: []
59
20
  files:
60
21
  - .gitignore
61
22
  - .gitmodules
23
+ - .travis.yml
62
24
  - .yardoc/checksums
63
25
  - .yardoc/objects/root.dat
64
26
  - .yardoc/proxy_types
@@ -68,7 +30,6 @@ files:
68
30
  - LICENSE
69
31
  - README.markdown
70
32
  - Rakefile
71
- - gem-public_cert.pem
72
33
  - gibberish.gemspec
73
34
  - lib/gibberish.rb
74
35
  - lib/gibberish/aes.rb
data.tar.gz.sig DELETED
Binary file
data/gem-public_cert.pem DELETED
@@ -1,19 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDHjCCAgagAwIBAgIBADANBgkqhkiG9w0BAQUFADA1MQowCAYDVQQDDAFtMRMw
3
- EQYKCZImiZPyLGQBGRYDbWRwMRIwEAYKCZImiZPyLGQBGRYCaW0wHhcNMTMwMjEx
4
- MTYwNjAxWhcNMTQwMjExMTYwNjAxWjA1MQowCAYDVQQDDAFtMRMwEQYKCZImiZPy
5
- LGQBGRYDbWRwMRIwEAYKCZImiZPyLGQBGRYCaW0wggEiMA0GCSqGSIb3DQEBAQUA
6
- A4IBDwAwggEKAoIBAQCsyb70vRSb3hfN5Go04jz84/XRf68uJD9NeNyE0y+lylOY
7
- jWEMaLu9TE2kYKOAvyZ/9+ioK19P+se1jCTIM+PZ11bz4Wmgk23XqmuSjA6v1dEA
8
- rlmsudYmlW36VviSIdTN3rvwoSiB+XXiUujF97nhvjxBpxnc1hJkxRz4KYwjjUPd
9
- NiGxK2GULOVwEEk5BScIG+FFJd/NKHF8tkxiiZNyjZDIwTvqMhYpnr/VRX+EsCkr
10
- A9j1a1GRyAHSUtxWuqjpWaXff2CEg5JavLZk1P74Zxx0c+rpsvY+bD0w9bMyNdgu
11
- jxxRo0Ompt3sCfpPwdp1hTBHJycrsdfH9rscQ7SPAgMBAAGjOTA3MAkGA1UdEwQC
12
- MAAwHQYDVR0OBBYEFLqZ2ITNwA6y/W8sBBWIUECnr5KjMAsGA1UdDwQEAwIEsDAN
13
- BgkqhkiG9w0BAQUFAAOCAQEAWRYRvVRJadDNC5zUEakTzrxb45Ket7dkTn8ejvHK
14
- nYtr9rjtreDjUrXSrQ9rThIMvcmMixyflSF93n5cqWYPFkU0V0p7s8K6b0vmRk6d
15
- iALE8XKqQKqzQSxk4r9FZeM/hk1FC2WBwjuNEy5tcpLF4KERVJzYq54mIyWDUV5c
16
- VJKW8u5/Wu2D4LNNIkwkhh2ULYOA6UBVwMrjp0ZHpV7jrt8SIyl1c7ONhnY0Pxey
17
- mxtia3OcUaHjfnuLeQqK7YpQCM2f/8sur+kpDjXH0DYTjmlOvZ07JI0Isd7zobrL
18
- 2NEhdVRiMlG7L/ncFwqpHzWFY0r37QIQ9UwO5+t6lC9Cfg==
19
- -----END CERTIFICATE-----
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- �����k֋缺����4:����[��@��9���[��9g�{�;�g���e�J/T�P��6P��OBt��X�ɧk ���� }���䐂$�֬l��9e�f��%V<�a���e� �=!�`t����4�W����K�R�����|J�`�1M����!�D��#��%3�ʏZ���_�R�8�e��>b`>/�kfa��4L��Y��Ws��64��:�ʉ��
2
- I�#y+$�DUzSF��C�C����7 ��O