A graphical encryption system that implements a custom block cipher algorithm based on a Substitution-Permutation Network (SPN), specifically designed to secure package tracking codes in legacy logistics systems using string manipulations and bitwise operations.
- Custom SPN Block Cipher: 32-round Substitution-Permutation Network over a 36-character alphabet (A-Z, 0-9) with 20-character fixed blocks.
- String-Only Implementation: Deliberately avoids lists and dynamic arrays, relying solely on strings, integers, and bitwise operations.
- Shannon's Principles in Practice: Implements Confusion (chained substitution with carry mechanism) and Diffusion (fixed bijection transposition) as core cryptographic foundations.
- Avalanche Effect Analysis: Built-in single-bit perturbation tests to verify cipher resilience and diffusion quality across rounds.
- Round-by-Round Reporting: Detailed trace of internal block states at rounds 1, 8, and 32, or exhaustive output for all 32 rounds.
- No External Dependencies: Uses only the Python standard library (
tkinterfor GUI), making it cross-platform with zero setup overhead. - Mathematical Validation: Experimentally demonstrates resistance to differential and linear cryptanalysis with quantified probability metrics.
- Clone the repository
git clone https://github.com/CamiloAT/block-cipher.git
cd block-cipher- Verify Python version
Ensure you have Python 3.6 or higher installed:
python --version- Run the application
No installation or dependency setup is required. Launch the GUI directly:
python block_cipher.pyNote: The application uses
tkinter, which is included by default in most Python distributions. Iftkinteris not available, install it via your system's package manager (e.g.,sudo apt-get install python3-tkon Debian/Ubuntu).
- Use the application
Enter a logistics tracking code (e.g., PKG2024ABCDEF1234) in the message field and select one of the available operations from the GUI buttons.
block-cipher/
├── block_cipher.py ← Main application: SPN cipher algorithm + Tkinter GUI
├── README.md ← Project documentation
| Layer | Technology |
|---|---|
| Language | Python 3.6+ |
| GUI Framework | Tkinter (standard library) |
| GUI Components | tkinter.scrolledtext, tkinter.messagebox |
| System | sys (stdout redirection) |
| Dependencies | None (standard library only) |
| Name | GitHub |
|---|---|
| Diego Fernando Aguirre Tenjo | @elcokiin |
| Camilo Andres Arias Tenjo | @CamiloAT |
| Katlyn Jennelis Galvis Rodriguez | @Katlyng |
Cryptography & Applied Security