/sg41

A historically accurate simulator of the Schlüsselgerät 41 Cipher Machine.

Primary LanguageC++MIT LicenseMIT

sg41

A historically accurate simulator of the Schlüsselgerät 41 Cipher Machine

The Schlüsselgerät 41 was a mechanical cipher machine developed by Wanderer in modern-day Chemnitz, Germany. It was primarily used by the German Intelligence Service for securing top-secret communications.

Usage

import sg41

machine = sg41.SG41(
    sg41.Wheel.from_pattern_str("0001101011000100010001101"),
    sg41.Wheel.from_pattern_str("0110100100001011100101100"),
    sg41.Wheel.from_pattern_str("11001001000100100100010"),
    sg41.Wheel.from_pattern_str("01001000111010001110010"),
    sg41.Wheel.from_pattern_str("001001001010000101011010"),
    sg41.Wheel.from_pattern_str("011001100110001011010100")
)

print(
    machine.crypt("SCHLUESSELGERAETVIEREINSWANDERER", key=[0, 1, 2, 3, 0, 0])
) # IHEPLRETQSDSNDCWHPIVVGLYMHOWSJQS

This example has been designed to match the example provided in the Simulation section of Kopacz & Reuvers' paper.

References

License

MIT