Files
EnigmaMachine/README.md

39 lines
1.2 KiB
Markdown

# Enigma Machine
Recreates the functionality of the Enigma Machine from World War II. Mainly just an exercise in Python.
## Usage
`uv run main.py "[message]" e|d [int]`
Where:
- __"[message]"__ is the message to be encrypted/decrypted. Should be in quotes.
- __e|d__ is the direction of the message (encrypt or decrypt).
- __int__ is the number of iterations to be made.
### Seed Values
When encrypting a message, a file will be written to the current directory. This file contains the seed values used to
generate the encryption/decryption keys.
The seed values are integers between 0 and 58. In the file, each seed value is on a new line.
The number of iterations should match the number of seed values used.
### Examples
#### Encode
Encode the message "You are here." with three iterations.
`uv run main.py "You are here." e 3`
The command above will create a file called "seed_values.txt" with the generated seed values.
#### Decode
Decode the message "NTb!QDbGDQDa" with three iterations.
`uv run main.py '.NTb!QDbGDQDa' d 3`
The command above expects a file called "seed_values.txt" with the seed values used to encode the message from the preceding example.
## TODO
- [ ] Add a param to tell the `encode` function to use an existing seed file.