Class: EncryptedStrings::Cipher
- Inherits:
-
Object
- Object
- EncryptedStrings::Cipher
- Defined in:
- lib/encrypted_strings/cipher.rb
Overview
Represents the base class for all ciphers. By default, all ciphers are assumed to be able to decrypt strings. Note, however, that certain encryption algorithms do not allow decryption.
Direct Known Subclasses
Instance Method Summary collapse
-
#can_decrypt? ⇒ Boolean
Can this string be decrypted? Default is true.
-
#decrypt(data) ⇒ Object
Attempts to decrypt the given data using the current configuration.
Instance Method Details
#can_decrypt? ⇒ Boolean
Can this string be decrypted? Default is true.
7 8 9 |
# File 'lib/encrypted_strings/cipher.rb', line 7 def can_decrypt? true end |
#decrypt(data) ⇒ Object
Attempts to decrypt the given data using the current configuration. By default, decryption is not implemented.
13 14 15 |
# File 'lib/encrypted_strings/cipher.rb', line 13 def decrypt(data) raise NotImplementedError, "Decryption is not supported using a(n) #{self.class.name}" end |