Class: Gibberish::AES
- Inherits:
-
Object
- Object
- Gibberish::AES
- Defined in:
- lib/ext/aes_crypt.rb
Defined Under Namespace
Instance Method Summary collapse
-
#decrypt(ciphertext) ⇒ Object
Returns a Plaintext object (essentially a String with an additional ‘adata’ attribute).
-
#encrypt(data, authenticated_data = '') ⇒ Object
Returns the ciphertext in the form of a JSON string.
-
#initialize(password, opts = {}) ⇒ AES
constructor
Returns the AES object.
Constructor Details
Instance Method Details
#decrypt(ciphertext) ⇒ Object
Returns a Plaintext object (essentially a String with an additional ‘adata’ attribute)
31 32 33 |
# File 'lib/ext/aes_crypt.rb', line 31 def decrypt(ciphertext) @cipher.decrypt(ciphertext) end |
#encrypt(data, authenticated_data = '') ⇒ Object
Returns the ciphertext in the form of a JSON string
24 25 26 |
# File 'lib/ext/aes_crypt.rb', line 24 def encrypt(data, authenticated_data='') @cipher.encrypt(data, authenticated_data) end |