<commit_before>require 'openssl'
require 'active_support/base64'

module ActiveSupport
  # MessageEncryptor is a simple way to encrypt values which get stored somewhere
  # you don't trust.
  #
  # The cipher text and initialization vector are base64 encoded and returned to you.
  #
  # This can be used in situations similar to the <tt>MessageVerifier</tt>, but where you don't
  # want users to be able to determine the value of the payload.
  class MessageEncryptor
    class InvalidMessage < StandardError; end
    OpenSSLCipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError

    def initialize(secret, options = {})
      unless options.is_a?(Hash)
        ActiveSupport::Deprecation.warn "The second parameter should be an options hash. Use :cipher => 'algorithm' to sepcify the cipher algorithm."
        options = { :cipher => options }<commit_msg>Fix typo in deprecation warning.<commit_after>require 'openssl'
require 'active_support/base64'

module ActiveSupport
  # MessageEncryptor is a simple way to encrypt values which get stored somewhere
  # you don't trust.
  #
  # The cipher text and initialization vector are base64 encoded and returned to you.
  #
  # This can be used in situations similar to the <tt>MessageVerifier</tt>, but where you don't
  # want users to be able to determine the value of the payload.
  class MessageEncryptor
    class InvalidMessage < StandardError; end
    OpenSSLCipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError

    def initialize(secret, options = {})
      unless options.is_a?(Hash)
        ActiveSupport::Deprecation.warn "The second parameter should be an options hash. Use :cipher => 'algorithm' to specify the cipher algorithm."
        options = { :cipher => options }
{'fraction_non_alphanumeric': 0.07825148407987048, 'fraction_numerical': 0.004317323259579061, 'mean_word_length': 4.237288135593221, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3134258', 'n_tokens_mistral': 512, 'n_tokens_neox': 492, 'n_words': 194}