<commit_before>Adaptive Mirror Field
=====================

To explain what an adaptive mirror field is, let's
first expain what a plain, non-adaptive mirror field is.

Non-Adaptive Mirror Field
-------------------------

A **mirror field** is a square grid that contains randomly placed diagonal
mirrors. Characters that can be encrypted are placed around the perimeter
of the mirror field. Encryption occurres by standing on the character you
wish to encrypt and looking straight in to the mirror field. The mirrors
will reflect back the encrypted character.

Mirror Field Example:

```
                A B C D E
               -----------
              K: :/: :\: :F
               -----------
              L: : :\: :/:G
  Input        -----------       Output
 ------- ==>  M:\: : :/: :H  ==> -------
 "ABCDE"       -----------       "MKEFC"
              N:\:/: : : :I
               -----------
              O: : :/: :\:J
               -----------
                P Q R S T
```

In prqactice, using this sort of mirror field for encryption is weak. The
same character of output is always produced for the same character of
input, making it easily defeatable.

```
                A B C D E
               -----------
              K: :/: :\: :F
               -----------
              L: : :\: :/:G
  Input        -----------       Output
 ------- ==>  M:\: : :/: :H  ==> -------
 "CCCCC"       -----------       "EEEEE"
              N:\:/: : : :I
               -----------
              O: : :/: :\:J
               -----------
                P Q R S T
```

Adaptive Mirror Field
---------------------

In an *adaptive* mirror field the orientation of the mirrors that are used to process a character change once the processing of that character is complete.
This produces a unique mirror field permutation for every character and ensures that duplicate characters of input produce varying characters of output.

![Adaptve Mirror Field](http://i.imgur.com/sp8g4vr.gif)

While this "adaptive" feature is a big improvement, there are still weaknesses in cases where there few mirrors between the input and output characters.
In a case where there is only one mirror, given that there are only 3 mirror orientations, every third character output would repeat when given all identical input characters.
To eliminate this issue, the adaptve feature also include *perimiter character rolling*, whereby each character on the perimeter rolls it's position clockwise by 1.

[Animation here]

<commit_msg>Documentation update<commit_after>Adaptive Mirror Field
=====================

To explain what an adaptive mirror field is, let's
first expain what a plain, non-adaptive mirror field is.

Non-Adaptive Mirror Field
-------------------------

A **mirror field** is a square grid that contains randomly placed diagonal
mirrors. Characters that can be encrypted are placed around the perimeter
of the mirror field. Encryption occurres by standing on the character you
wish to encrypt and looking straight in to the mirror field. The mirrors
will reflect back the encrypted character.

Mirror Field Example:

```
                A B C D E
               -----------
              K: :/: :\: :F
               -----------
              L: : :\: :/:G
  Input        -----------       Output
 ------- ==>  M:\: : :/: :H  ==> -------
 "ABCDE"       -----------       "MKEFC"
              N:\:/: : : :I
               -----------
              O: : :/: :\:J
               -----------
                P Q R S T
```

In prqactice, using this sort of mirror field for encryption is weak. The
same character of output is always produced for the same character of
input, making it easily defeatable.

```
                A B C D E
               -----------
              K: :/: :\: :F
               -----------
              L: : :\: :/:G
  Input        -----------       Output
 ------- ==>  M:\: : :/: :H  ==> -------
 "CCCCC"       -----------       "EEEEE"
              N:\:/: : : :I
               -----------
              O: : :/: :\:J
               -----------
                P Q R S T
```

Adaptive Mirror Field
---------------------

In an *adaptive* mirror field the orientation of the mirrors that are used to process a character change once the processing of that character is complete.
This produces a unique mirror field permutation for every character and ensures that duplicate characters of input produce varying characters of output.

![Adaptve Mirror Field](http://i.imgur.com/sp8g4vr.gif)

While this "adaptive" feature is a big improvement, there are still weaknesses in cases where there few mirrors between the input and output characters.
In a case where there is only one mirror, given that there are only 3 mirror orientations, every third out character would repeat when given all identical input characters.

To eliminate this issue, mrrcrypt employs *perimiter character rolling*, whereby each character on the perimeter rolls it's position clockwise by 1 after every character is processed.

[Animation here]


{'fraction_non_alphanumeric': 0.15549385164617216, 'fraction_numerical': 0.0015866719555731853, 'mean_word_length': 1.6306729264475743, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4298170', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1199, 'n_words': 587}