Sha256: a41929f7625954f909d0f99a72f8c64054d10eb383b1821562834b82b3c9ad6d
Contents?: true
Size: 564 Bytes
Versions: 11
Compression:
Stored size: 564 Bytes
Contents
# frozen_string_literal: true require 'openssl' require 'pg_export/import' class PgExport module Factories class CipherFactory include Import['config'] def encryptor cipher(:encrypt) end def decryptor cipher(:decrypt) end private ALGORITHM = 'AES-128-CBC' private_constant :ALGORITHM def cipher(type) OpenSSL::Cipher.new(ALGORITHM).tap do |cipher| cipher.public_send(type) cipher.key = config.dump_encryption_key end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems