Symmetric encryption implementation based on graph theory
Table of Contents
Graph-Based Symmetric Encryption#
I implemented a symmetric encryption algorithm based on Prim’s minimum spanning tree algorithm. This method isn’t especially practical due to its performance characteristics, but I find the mathematical approach fascinating! :)
Here is the GitHub repository with the full implementation.
Research and Implementation#

The algorithm uses graph theory concepts to create a unique encryption scheme:
- Graph Construction: Create a graph from the input data
- Spanning Tree: Use Prim’s algorithm to generate a minimum spanning tree
- Matrix Operations: Convert the tree structure into matrices for encryption/decryption
- Key Generation: The spanning tree serves as part of the encryption key
Research Papers#
Here are the papers I referenced while developing this algorithm (note: some contain errors, particularly in matrix multiplication order):
- Graph Theory Based Encryption Algorithm - IJARSE
- ISSN: 2456-8686, Volume 2, Issue 1, 2018:97-104 / DOI: http://doi.org/10.26524/cm32
- ResearchGate: Encryption Algorithm Using Graph Theory
Performance Analysis#
While this approach is mathematically interesting, it has some limitations:
- Speed: Significantly slower than traditional symmetric encryption
- Complexity: High computational overhead for graph operations
- Scalability: Performance degrades with larger input sizes
However, it provides unique properties that could be useful in specific scenarios where traditional methods aren’t suitable.
Future Work#
This project is ongoing with several planned improvements:
- CLI Interface: Making it easily usable from the command line
- Performance Optimization: Exploring ways to improve speed
- Security Analysis: Formal security evaluation
- Practical Applications: Finding use cases where this approach excels
Contributing#
Feel free to contribute or fork the project to make it better! I’m particularly interested in:
- Performance optimizations
- Security analysis
- Alternative graph algorithms
- Real-world applications
Your contributions and feedback are always welcome!