<commit_before>defmodule Cloak.AES.CTR do
  @moduledoc """
  A `Cloak.Cipher` which encrypts values with the AES cipher in CTR (stream) mode.

  ## Configuration

  In addition to the normal `:default` and `:tag` configuration options, this 
  cipher takes a `:keys` option to support using multiple AES keys at the same 
  time.

      config :cloak, Cloak.AES.CTR,
        default: true,
        tag: "AES",
        keys: [
          %{tag: <<1>>, key: :base64.decode("..."), default: true},
          %{tag: <<2>>, key: :base64.decode("..."), default: false}
        ]

  ### Key Configuration Options

  A key may have the following attributes:

  - `:tag` - The ID of the key. This is included in the ciphertext, and should be
    only a single byte. See `encrypt/2` for more details.

  - `:key` - The AES key to use, in binary. If you store your keys in Base64
    format you will need to decode them first.

  - `:default` - Boolean. Whether to use this key by default or not.

  ## Upgrading to a New Key

  To upgrade to a new key, simply add the key to the `:keys` array, and set it<commit_msg>Inform that key must be 16, 24 or 32 bytes long<commit_after>defmodule Cloak.AES.CTR do
  @moduledoc """
  A `Cloak.Cipher` which encrypts values with the AES cipher in CTR (stream) mode.

  ## Configuration

  In addition to the normal `:default` and `:tag` configuration options, this 
  cipher takes a `:keys` option to support using multiple AES keys at the same 
  time.

      config :cloak, Cloak.AES.CTR,
        default: true,
        tag: "AES",
        keys: [
          %{tag: <<1>>, key: :base64.decode("..."), default: true},
          %{tag: <<2>>, key: :base64.decode("..."), default: false}
        ]

  ### Key Configuration Options

  A key may have the following attributes:

  - `:tag` - The ID of the key. This is included in the ciphertext, and should be
    only a single byte. See `encrypt/2` for more details.

  - `:key` - The AES key to use, in binary. If you store your keys in Base64
    format you will need to decode them first. The key must be 128, 192, or 256 bits 
    long (16, 24 or 32 bytes, respectively).

  - `:default` - Boolean. Whether to use this key by default or not.

  ## Upgrading to a New Key

  To upgrade to a new key, simply add the key to the `:keys` array, and set it
{'fraction_non_alphanumeric': 0.109106529209622, 'fraction_numerical': 0.01675257731958763, 'mean_word_length': 2.7027027027027026, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2733916', 'n_tokens_mistral': 780, 'n_tokens_neox': 702, 'n_words': 333}