lib/mack-encryption/default_worker.rb in mack-encryption-0.7.0.1 vs lib/mack-encryption/default_worker.rb in mack-encryption-0.7.1
- old
+ new
@@ -1,26 +1,26 @@
module Mack
module Utils # :nodoc:
module Crypt # :nodoc:
# The default worker is one that is used when no other worker is specified or the
- # specified worker does not exist. It uses the Crypt::Rijndael library and get's
+ # specified worker does not exist. It uses the EzCrypto library and get's
# it's secret key from app_config.default_secret_key
class DefaultWorker
def initialize
- @aes_key = ::Crypt::Rijndael.new(app_config.default_secret_key || (String.randomize(40)))
+ @aes_key = EzCrypto::Key.with_password((app_config.default_secret_key || (String.randomize(40))), Mack::VERSION)
end
- # Encrypts a string using the Crypt::Rijndael library and the secret key found in
+ # Encrypts a string using the EzCrypto library and the secret key found in
# app_config.default_secret_key
def encrypt(x)
- @aes_key.encrypt_string(x)
+ @aes_key.encrypt(x)
end
- # Decrypts a string using the Crypt::Rijndael library and the secret key found in
+ # Decrypts a string using the EzCrypto library and the secret key found in
# app_config.default_secret_key
def decrypt(x)
- @aes_key.decrypt_string(x)
+ @aes_key.decrypt(x)
end
end # DefaultWorker
end # Crypt
end # Utils
\ No newline at end of file