A corporation manager and dashboard for EVE Online
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- module Encryptor
- extend ActiveSupport::Concern
-
- class_methods do
- def encrypt(value)
- ensure_encryptor
- @crypt.encrypt_and_sign(value)
- end
-
- def decrypt(value)
- ensure_encryptor
- @crypt.decrypt_and_verify(value)
- end
-
- private
- def ensure_encryptor
- @crypt ||= ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base)
- end
- end
- end
|