Class: Glib::Crypt::Utils
- Inherits:
-
Object
- Object
- Glib::Crypt::Utils
- Defined in:
- lib/glib/crypt/utils.rb
Class Method Summary collapse
- .decrypt(encrypted_message, encryption_secret, encryption_salt) ⇒ Object
- .encrypt(original_message, encryption_secret, encryption_salt) ⇒ Object
Class Method Details
.decrypt(encrypted_message, encryption_secret, encryption_salt) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/glib/crypt/utils.rb', line 9 def self.decrypt(, encryption_secret, encryption_salt) encryptor = (encryption_secret, encryption_salt) begin encryptor.decrypt_and_verify(CGI.unescape()) rescue ActiveSupport::MessageEncryptor::InvalidMessage nil end end |
.encrypt(original_message, encryption_secret, encryption_salt) ⇒ Object
4 5 6 7 |
# File 'lib/glib/crypt/utils.rb', line 4 def self.encrypt(, encryption_secret, encryption_salt) encryptor = (encryption_secret, encryption_salt) CGI.escape(encryptor.encrypt_and_sign()) end |