Sha256: e4237585e6c8bad344d123f0d70c78667c9ee6c9a6af3931d10f4e4d14e71c83
Contents?: true
Size: 553 Bytes
Versions: 17
Compression:
Stored size: 553 Bytes
Contents
# frozen_string_literal: true module Decidim class AttributeEncryptor def self.encrypt(string) cryptor.encrypt_and_sign(string) if string.present? end def self.decrypt(string_encrypted) cryptor.decrypt_and_verify(string_encrypted) if string_encrypted.present? end def self.cryptor key = ActiveSupport::KeyGenerator.new("attribute").generate_key( Rails.application.secrets.secret_key_base, ActiveSupport::MessageEncryptor.key_len ) ActiveSupport::MessageEncryptor.new(key) end end end
Version data entries
17 entries across 17 versions & 1 rubygems