A simple command-line cipher tool written in Python. It encodes and decodes text by mapping each letter (English or Russian) to a "code word" defined in a JSON dictionary — for example h → Comet, и → Compass.
- Encode text into a sequence of code words
- Decode a sequence of code words back into text
- Supports both English and Russian alphabets out of the box
- Fully customizable cipher — just edit a JSON file, no code changes needed
- Python 3.10+ (uses
matchstatements)
No external dependencies — only the standard library is used.
-
Clone the repository:
git clone https://github.com/vipol0/Pycoder-CLI.git cd Pycoder-CLI -
Run the program:
python main.py
-
Choose an option from the menu:
Menu: [1] Code [2] Decode [3] Exit >
Encoding:
> 1
Enter text: hello
Comet Forest Violin Violin Window
Decoding:
> 2
Enter text: Comet Forest Violin Violin Window
hello
Spaces between words are represented as - in the encoded text.
The cipher mapping lives entirely in cipher_secret.json — you don't need to touch main.py to customize it.
The file has two sections, "english" and "russian", each mapping a letter to a code word:
{
"english": {
"a": "Table",
"b": "River",
...
},
"russian": {
"а": "Bronze",
"б": "Crystal",
...
}
}To create your own cipher:
- Open
cipher_secret.json. - Replace the code words with anything you like (any string works — words, emojis, numbers as strings, etc.).
- Keep the letter keys (
"a","b","а","б", ...) unchanged, and make sure every value is unique — otherwise decoding will be ambiguous. - Save the file and run
main.pyagain. Your new dictionary will be used automatically.
You can also add entirely new languages/alphabets by adding another section (e.g. "french") — just make sure main.py's dictionary-merging logic includes it if you do.
This project is licensed under the MIT License — see the LICENSE file for details.