# Rotor Machines

Rotor machines implement complex polyalphabetic ciphers

* Each rotor contains a permutation.
  * Same as a set of substitutions.
* The position of a rotor implements a substitution alphabet.
* Spinning of a rotor implements a polyalphabetic cipher.
* Stacking several rotors and spinning them at different times adds complexity to the cipher.

The cipher key is:

* The set of rotors used.
* The relative order of the rotors.
* The position of the spinning ring.
* The original position of all the rotors.

Symmetrical (two-way) rotors allow decryption by "double encryption".

* Using a reflection disk (half-rotor)

Reciprocal operation with reflector

* Sending operator types "A" as plaintext and gets "Z" as ciphertext, which is transmitted.
* Receiving operator types the received "Z" and gets the plaintext "A".
* No letter could encrypt to itself!

<figure><img src="/files/YO5EdY9AFeaf17ydNNf1" alt=""><figcaption></figcaption></figure>

## Enigma

* WWII German rotor machine
  * Many models used.
* Initially presented in 1919.
  * Enigma I, with 3 rotors.
* Several variants where used.
  * With different number of rotors.
  * With patch cord to permute alphabets.
* Key settings distributed in codebooks.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidjosearaujo.gitbook.io/notes-mcs/applied-cryptography/classical-symmetric-cryptography/rotor-machines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
