Sha256: bfdd8733c1d48e40eb29653428f9d46b7a9fe9abbefec6c37f820324695e25e2

Contents?: true

Size: 594 Bytes

Versions: 5

Compression:

Stored size: 594 Bytes

Contents

module EncryptedStrings
  # 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.
  class Cipher
    # Can this string be decrypted?  Default is true.
    def can_decrypt?
      true
    end
    
    # Attempts to decrypt the given data using the current configuration.  By
    # default, decryption is not implemented.
    def decrypt(data)
      raise NotImplementedError, "Decryption is not supported using a(n) #{self.class.name}"
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
pluginaweek-encrypted_strings-0.3.2 lib/encrypted_strings/cipher.rb
encrypted_strings-0.3.3 lib/encrypted_strings/cipher.rb
encrypted_strings-0.3.0 lib/encrypted_strings/cipher.rb
encrypted_strings-0.3.1 lib/encrypted_strings/cipher.rb
encrypted_strings-0.3.2 lib/encrypted_strings/cipher.rb