Class: Auther::Cipher
- Inherits:
- 
      Object
      
        - Object
- Auther::Cipher
 
- Defined in:
- lib/auther/cipher.rb
Overview
Manages encryption/decryption.
Instance Method Summary collapse
- #decrypt(data) ⇒ Object
- #encrypt(data) ⇒ Object
- 
  
    
      #initialize(secret)  ⇒ Cipher 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Cipher. 
Constructor Details
#initialize(secret) ⇒ Cipher
Returns a new instance of Cipher.
| 6 7 8 | # File 'lib/auther/cipher.rb', line 6 def initialize secret @encryptor = ActiveSupport::MessageEncryptor.new secret end | 
Instance Method Details
#decrypt(data) ⇒ Object
| 14 15 16 | # File 'lib/auther/cipher.rb', line 14 def decrypt data encryptor.decrypt_and_verify data end | 
#encrypt(data) ⇒ Object
| 10 11 12 | # File 'lib/auther/cipher.rb', line 10 def encrypt data encryptor.encrypt_and_sign data end |