cf_crypto 0.0.1 → 0.0.2
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.
- data/lib/cf_crypto/version.rb +1 -1
- data/lib/cf_crypto.rb +1 -1
- data/spec/cf_crypto_spec.rb +31 -11
- data/spec/spec_helper.rb +2 -0
- metadata +4 -4
data/lib/cf_crypto/version.rb
CHANGED
data/lib/cf_crypto.rb
CHANGED
data/spec/cf_crypto_spec.rb
CHANGED
@@ -2,19 +2,39 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "CfCrypto" do
|
4
4
|
|
5
|
-
|
5
|
+
describe "DES" do
|
6
6
|
|
7
|
-
|
7
|
+
let!(:cf_data) do
|
8
|
+
{
|
9
|
+
:key => '8nqocAg7V5s=',
|
10
|
+
:encrypted => '90DEA49CE5CDF98F52862A258F468EC66F89D687DD0DC8A8',
|
11
|
+
:decrypted => 'Super cool test string.'
|
12
|
+
}
|
13
|
+
end
|
8
14
|
|
9
|
-
let(:
|
15
|
+
let!(:data) do
|
16
|
+
{
|
17
|
+
:decrypted => 'You can read this because its not encrypted.',
|
18
|
+
:key => '2nrmcGw9P2v='
|
19
|
+
}
|
20
|
+
end
|
10
21
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
result = CfCrypto::DES.decrypt(result, des_key)
|
15
|
-
result.should eq(sensitive_information)
|
16
|
-
end
|
22
|
+
before do
|
23
|
+
puts
|
24
|
+
end
|
17
25
|
|
18
|
-
|
26
|
+
it "should encrypt and decrypt a string" do
|
27
|
+
result = CfCrypto::DES.encrypt(data[:decrypted], data[:key])
|
28
|
+
result.should_not eq(data[:decrypted])
|
29
|
+
result = CfCrypto::DES.decrypt(result, data[:key])
|
30
|
+
result.should eq(data[:decrypted])
|
31
|
+
end
|
19
32
|
|
20
|
-
|
33
|
+
it "should decrypt a string encrypted by ColdFusion" do
|
34
|
+
result = CfCrypto::DES.decrypt(cf_data[:encrypted], cf_data[:key])
|
35
|
+
result.should eq(cf_data[:decrypted])
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf_crypto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152660620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152660620
|
25
25
|
description: A gem that helps Ruby applications exchange encrypted data with ColdFusion.
|
26
26
|
email:
|
27
27
|
- ryan.ricard@gmail.com
|