Sha256: 15c8b7c51d1bac2f2cc526f8493b303d7fa4f9c19d9ffe752a17c5d14855d069
Contents?: true
Size: 967 Bytes
Versions: 22
Compression:
Stored size: 967 Bytes
Contents
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 # 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))) end # Encrypts a string using the Crypt::Rijndael library and the secret key found in # app_config.default_secret_key def encrypt(x) @aes_key.encrypt_string(x) end # Decrypts a string using the Crypt::Rijndael library and the secret key found in # app_config.default_secret_key def decrypt(x) @aes_key.decrypt_string(x) end end # DefaultWorker end # Crypt end # Utils end # Mack
Version data entries
22 entries across 22 versions & 2 rubygems