Small, tested Python projects that explain security concepts through code.
flowchart LR
A["User selects an operation"] --> B{"Encode or decode"}
B -->|Encode| C["Apply substitution mapping"]
B -->|Decode| D["Apply inverse mapping"]
C --> E["Preserve case and punctuation"]
D --> E
E --> F["Display transformed message"]
G["Unit tests"] --> C
G --> D
A command-line monoalphabetic substitution cipher with reusable encode/decode functions, input validation, and automated tests.
The two CLI captures demonstrate both transformation directions while preserving capitalization, spaces, numbers, and punctuation.
Run it with:
python substitution-cipher/substitution_cipher.py
python -m unittest discover -s tests -vConcepts demonstrated:
- Reversible character transformations
- Separation of reusable logic from the command-line interface
- Input validation and unit testing
- Why classical substitution is unsuitable for real security
This is an educational cryptography exercise, not secure encryption.
The test suite checks a known encoding, reversible round trips, preservation of case and punctuation, and rejection of invalid substitution keys.
Run the test suite with python -m unittest discover -s tests -v to verify the reversible transformation and input validation behavior.
Run the test suite with python -m unittest discover -s tests -v to verify the reversible transformation and input validation behavior.
Built by Ahmed Balde as part of a broader cybersecurity and Python engineering portfolio. See more work on GitHub.


