Sha256: 7ee62f3f0750d649eb7dde3c83bebfa1eda9a2d8e05e771b59f88bcf50b38891

Contents?: true

Size: 380 Bytes

Versions: 9

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

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

9 entries across 9 versions & 1 rubygems

Version Path
auther-9.1.0 lib/auther/cipher.rb
auther-9.0.0 lib/auther/cipher.rb
auther-8.1.1 lib/auther/cipher.rb
auther-8.1.0 lib/auther/cipher.rb
auther-8.0.0 lib/auther/cipher.rb
auther-7.1.0 lib/auther/cipher.rb
auther-7.0.0 lib/auther/cipher.rb
auther-6.1.0 lib/auther/cipher.rb
auther-6.0.0 lib/auther/cipher.rb