Class Mack::Utils::Crypt::DefaultWorker
In: lib/mack-encryption/default_worker.rb
Parent: Object

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

Methods

decrypt   encrypt   new  

Public Class methods

[Source]

    # File lib/mack-encryption/default_worker.rb, line 9
 9:         def initialize
10:           @aes_key = ::Crypt::Rijndael.new(app_config.default_secret_key || (String.randomize(40)))
11:         end

Public Instance methods

Decrypts a string using the Crypt::Rijndael library and the secret key found in app_config.default_secret_key

[Source]

    # File lib/mack-encryption/default_worker.rb, line 21
21:         def decrypt(x)
22:           @aes_key.decrypt_string(x)
23:         end

Encrypts a string using the Crypt::Rijndael library and the secret key found in app_config.default_secret_key

[Source]

    # File lib/mack-encryption/default_worker.rb, line 15
15:         def encrypt(x)
16:           @aes_key.encrypt_string(x)
17:         end

[Validate]