pyenigma.py(1)

πŸ’– pyenigma.py β€” the manual page, bestie edition πŸ’–

okay so this is the manual for pyenigma.py(1) (that's the section-1 manual, the user-commands one, iykyk) and it's literally about running an Enigma machine from your terminal. like, the actual WWII rotor cipher, but make it a CLI. slay. πŸŽ€

✨ NAME ✨

pyenigma.py β€” encrypt/decrypt text according to Enigma machine key settings

no cap, that's the whole vibe. you give it settings, it scrambles or un-scrambles your text. πŸ’…

🌸 SYNOPSIS 🌸

pyenigma.py [-h] [-k KEY_FILE] [-d DAY] [-r ROTOR [ROTOR ...]]
            [-i RING_SETTING [RING_SETTING ...]]
            [-p PLUGBOARD [PLUGBOARD ...]] [-u REFLECTOR] [-s START]
            [-t TEXT] [-f FILE] [-x REPLACE_CHAR] [-z] [-v]

look at all those little flags, they're giving very much "I have options and I know it" energy. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

pyenigma.py is a command line for processing Enigma messages. periodt. πŸ’œ

so here's the tea: your Enigma settings can either be specified by command-line arguments, or read from a key file. both are valid, pick your fighter. if you're reading from a key file, the line labeled with the current day number is used β€” unless you hand it the --day argument, in which case that wins. πŸ—“οΈ

now, the text you wanna process? it can be supplied 3 ways:

  • if --text=TEXT is present, then TEXT is what gets processed πŸ“
  • if --file=FILE is present, then the contents of FILE get processed πŸ“‚
  • otherwise, the text is read from standard input ⌨️

and bestie, please see documentation for the description of the file format β€” don't just guess at it, the docs are right there and they're free. 🫢


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” show this help message and exit. the classic. the icon. use it when you're lost (we've all been there) πŸ™ˆ
  • -k KEY_FILE, --key-file KEY_FILE β€” path to key file for daily settings πŸ—οΈ
  • -d DAY, --day DAY β€” use the settings for day DAY when reading key file πŸ“…
  • -r ROTOR [ROTOR ...], --rotors ROTOR [ROTOR ...] β€” rotor list ordered from left to right; e.g III IV I βš™οΈ
  • -i RING_SETTING [RING_SETTING ...], --ring-settings RING_SETTING [RING_SETTING ...] β€” ring setting list from left to right; e.g. A A J πŸ’
  • -p PLUGBOARD [PLUGBOARD ...], --plugboard PLUGBOARD [PLUGBOARD ...] β€” plugboard settings πŸ”Œ
  • -u REFLECTOR, --reflector REFLECTOR β€” reflector name πŸͺž
  • -s START, --start START β€” starting position 🚩
  • -t TEXT, --text TEXT β€” text to process ✍️
  • -f FILE, --file FILE β€” input file to process πŸ“
  • -x REPLACE_CHAR, --replace-char REPLACE_CHAR β€” if the input text contains chars not found on the enigma keyboard, replace with this char [default: X] πŸ”„
  • -z, --delete-chars β€” if the input text contains chars not found on the enigma keyboard, delete them from the input πŸ—‘οΈ
  • -v, --verbose β€” provide verbose output; include final rotor positions πŸ—£οΈ
heads up bestie: -x and -z are both about those off-keyboard chars, so know which one you actually want β€” replace them or yeet them entirely. ✨

🌈 EXAMPLE 🌈

Try these commands to specify settings from the command line:

$ pyenigma.py -r III IV V -i 1 2 3 -p AB CD EF GH IJ KL MN -u B -s XYZ
$ pyenigma.py -r Beta III IV V -i A B C D -p 1/2 3/4 5/6 -u B-Thin -s WXYZ

This command will load Enigma settings from a file:

$ pyenigma.py --key-file=enigma.keys -s XYZ -t HELLOXWORLDX

the way that second one is doing a full four-rotor situation with Beta, B-Thin, and plugboard pairs with slashes in them?? highkey iconic. πŸ’œ


πŸŽ€ AUTHOR πŸŽ€

Brian Neal <bgneal@gmail.com>

thank you for your service, Brian, fr fr 🫑


and that's the whole page, bestie!! written for the pyenigma.py(1) manual, dated 26 Apr 2015, from the pyenigma.py(1) source. go forth and encipher, you absolute main character πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from