mack-encryption 0.7.1.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mack-encryption/default_worker.rb +4 -4
- metadata +3 -3
@@ -3,21 +3,21 @@ module Mack
|
|
3
3
|
module Crypt # :nodoc:
|
4
4
|
# The default worker is one that is used when no other worker is specified or the
|
5
5
|
# specified worker does not exist. It uses the EzCrypto library and get's
|
6
|
-
# it's secret key from
|
6
|
+
# it's secret key from configatron.default_secret_key
|
7
7
|
class DefaultWorker
|
8
8
|
|
9
9
|
def initialize
|
10
|
-
@aes_key = EzCrypto::Key.with_password((
|
10
|
+
@aes_key = EzCrypto::Key.with_password(configatron.retrieve(:default_secret_key, String.randomize(40)), '_mackery_')
|
11
11
|
end
|
12
12
|
|
13
13
|
# Encrypts a string using the EzCrypto library and the secret key found in
|
14
|
-
#
|
14
|
+
# configatron.default_secret_key
|
15
15
|
def encrypt(x)
|
16
16
|
@aes_key.encrypt(x)
|
17
17
|
end
|
18
18
|
|
19
19
|
# Decrypts a string using the EzCrypto library and the secret key found in
|
20
|
-
#
|
20
|
+
# configatron.default_secret_key
|
21
21
|
def decrypt(x)
|
22
22
|
@aes_key.decrypt(x)
|
23
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mack-encryption
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-06 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements: []
|
61
61
|
|
62
62
|
rubyforge_project: magrathea
|
63
|
-
rubygems_version: 1.
|
63
|
+
rubygems_version: 1.3.0
|
64
64
|
signing_key:
|
65
65
|
specification_version: 2
|
66
66
|
summary: crypt/rijndael support for Mack
|