Sha256: 39b3b12458a20ae16f3460a287251d581202909b6914d61e6e7f5393c82a9b40

Contents?: true

Size: 349 Bytes

Versions: 2

Compression:

Stored size: 349 Bytes

Contents

module Auther
  # Manages encryption/decryption.
  class Cipher
    def initialize secret
      @encryptor = ActiveSupport::MessageEncryptor.new secret
    end

    def encrypt data
      encryptor.encrypt_and_sign data
    end

    def decrypt data
      encryptor.decrypt_and_verify data
    end

    private

    attr_reader :encryptor
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auther-5.0.1 lib/auther/cipher.rb
auther-5.0.0 lib/auther/cipher.rb