File: pyenigma.py.txt

package info (click to toggle)
python-enigma 0.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: python: 750; makefile: 132
file content (48 lines) | stat: -rw-r--r-- 3,208 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
NAME
  pyenigma.py - encrypt/decrypt text according to Enigma machine key settings
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]
DESCRIPTION
  pyenigma.py is a command line for processing Enigma messages.
  Enigma settings can either be specified by command-line arguments,
  or read from a key file. If reading from a key file, the line labeled
  with the current day number is used unless the --day argument is provided.

  Text to process can be supplied 3 ways:
    * if --text=TEXT is present TEXT is processed
    * if --file=FILE is present the contents of FILE are processed
    * otherwise the text is read from standard input

  Please see documentation for the description of the file format.
OPTIONS
  -h, --help                                                                            show this help message and exit
  -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

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

AUTHOR
  Brian Neal <bgneal@gmail.com>