Score:1

Enigma Questions: Eliminating the can't encode to itself flaw? Maybe not a flaw

kz flag

I am currently writing a paper in my old age for the fun of it. I feel that the enigma machine had gotten a bad wrap for some of its flaws. I decided to write a machine simulation to see if I can correct some of these flaws. The part of the "not being able to encode a character unto itself" isn't as large a flaw as first presented. In my version, I eliminated that flaw. At least, that is what it looks like.

I set up a test to ensure that it can encode to itself. And still be decrypted properly. I created an input file of fifty "A". Ran the encryption/decryption and, indeed, was able to encode 21 "A"'s to itself out of 50 characters, 42% of the data. Other test with others character types showed about the same results, between 9-21 characters. In an unrelated test, I saw this occur again.

So, the fix I believe was to treat the reflector like a plug board. I just randomly build character pairs for the plugboard. And then, just randomly build an alphabet string ensuring there no dups.

I think, the engineer that built the reflector may have put too much effort ensuring that a single entered from one end, had to exit on the opposite side of the reflector. I was planning on adding more notches to spin the rotors more. I thought that if I could make the last (left) rotor actually change more often, that it would have a better scramble. But, I hadn't coded that far, when I notice that it could encipher to itself.

Does this make sense? Am I off track on this?

Support files:

Input enter image description here

Encrypted enter image description here

Decrypted enter image description here

Device Log

   MSG:  >>> Begin Encrypt <<<

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encrypt()|Line: 88
   MSG: Message Size: 50 MSG: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:-

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:)

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:L

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:'

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:Z

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:I

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:(

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:J

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:N

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:U

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:W

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:8

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:Q

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:8

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:)

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:8

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:-

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:R

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:'

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:6

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:5

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:,

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:2

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:Z

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:K

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:D

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:3

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:'

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:S

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:I

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 169
   MSG: Input char:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encode()|Line: 195
   MSG: Output cipher:A

2023.05.15 19:20:57|INFO|PGM: Device|FNC: Encrypt()|Line: 102
   MSG: Encrypted Size: 50 Cipher: -)L'AZIAAA(AAJNAUWAA8Q8)A8-ARAA'6AAA5,AA2ZKDA3'SIA
Score:1
ru flag

The issue here is that you have a cryptographic scheme that is easy to implement in software, but not in the electro-mechanical technology of the Enigma machine. Mathematically, the Umkehrwalze pairs letters much like the Steckerbrett, however whereas the Steckerbrett could leave letters unpaired (equivalently pairing a letter with itself), this could not be done with the Umkehrwalze whilst due to the design of the machine.

Electrically at rest, all 26 wires corresponding to the letters of the alphabet were wired to one terminal of the battery. Depressing a key broke the connection of one of the wires and moved it to the other terminal. Current would then flow through this one wire and the wires of the Walzen before coming to the Umkehrwalze and heading back through the rotors on a different path, ending at a different letter which was therefore wired to the other terminal and completed the circuit.

If the Umkehrwalze had attempted to loop back a wire to itself, the current could not flow in both directions. Instead no circuit would be completed, just a wire with potential which could not cause a bulb to light up.

One could ask if the no fixed point property could have been managed in other ways. For example, if we remove the Umkehrwalze and just have exit wires at that point connecting to the other terminal. This would mean that the Enigma permutation only changes at one point per step (rather than twice in the actual design) and this is easier to attack (in fact the original Enigma A and B models did not have an Umkehrwalze). Alternatively, one could ask for more rotors and step more than rotor at each key press. This would add to the user effort and expense of construction. If you've ever pressed an Enigma key, you'll know that you have to transfer considerably more effort than a typewriter and this increases when more rotors turn.

I'd agree that people rather overstate the effect of the no-fixed point feature, but it is not an easy one to correct when one considers the limitations of the machine.

fgrieu avatar
ng flag
Addition: if we want to solve the no-fixed point issue and keep the feature that each rotor has two opportunities to scramble the in->out transformation without doubling the number of contacts on a rotor, it seems we need to use active circuitry somewhere. That what the [Fialka](https://www.cryptomuseum.com/crypto/fialka/magic.htm) does: it has three transistors in the reflector.
Daniel S avatar
ru flag
@fgrieu Agreed, but that requires 1950s technology.
DJ in Colorado avatar
kz flag
@fgrieu That is cool! I didn't know about that, I'll need to look into that.
DJ in Colorado avatar
kz flag
@DanielS, So, can I infer that coding the reflector was the solution, going from hardware to software? That would make sense. Thanks!
DJ in Colorado avatar
kz flag
I wonder if that would mean, anyone writing a simulation would also be able to encrypt a character to itself?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.