Skip to content

CamiloAT/block-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Custom Block Cipher for Logistics

Python License Status

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.


Main Features

  • 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 (tkinter for GUI), making it cross-platform with zero setup overhead.
  • Mathematical Validation: Experimentally demonstrates resistance to differential and linear cryptanalysis with quantified probability metrics.

Execution and Development Guide

  1. Clone the repository
git clone https://github.com/CamiloAT/block-cipher.git
cd block-cipher
  1. Verify Python version

Ensure you have Python 3.6 or higher installed:

python --version
  1. Run the application

No installation or dependency setup is required. Launch the GUI directly:

python block_cipher.py

Note: The application uses tkinter, which is included by default in most Python distributions. If tkinter is not available, install it via your system's package manager (e.g., sudo apt-get install python3-tk on Debian/Ubuntu).

  1. 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.


Project Structure

block-cipher/
├── block_cipher.py   ← Main application: SPN cipher algorithm + Tkinter GUI
├── README.md         ← Project documentation

Tech Stack

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)

Authors

Name GitHub
Diego Fernando Aguirre Tenjo @elcokiin
Camilo Andres Arias Tenjo @CamiloAT
Katlyn Jennelis Galvis Rodriguez @Katlyng

Cryptography & Applied Security

About

Custom block cipher (SPN network) in Python designed to secure logistics tracking codes. Includes a GUI and built-in cryptographic analysis tools.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages