Sha256: cc31b676a1aa03d13a6f2b26d4097e7771139885826a3253ef07dee09e687eb3
Contents?: true
Size: 516 Bytes
Versions: 5
Compression:
Stored size: 516 Bytes
Contents
# A fake class that does no encryption module CryptKeeperProviders class FakeEncryptor def initialize(*args) end end end # This class embeds the passphrase in the beginning of the string # and then reverses the 'plaintext' module CryptKeeperProviders class Encryptor def initialize(options = {}) @passphrase = options[:passphrase] end def encrypt(data) @passphrase + data.reverse end def decrypt(data) data.sub(/^#{@passphrase}/, '').reverse end end end
Version data entries
5 entries across 5 versions & 1 rubygems