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 EzCrypto 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 = EzCrypto::Key.with_password((app_config.default_secret_key || (String.randomize(40))), Mack::VERSION)
11:         end

Public Instance methods

Decrypts a string using the EzCrypto 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(x)
23:         end

Encrypts a string using the EzCrypto 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(x)
17:         end

[Validate]