Encryption Service¶
Features¶
Clone the Repository¶
To get started, clone this repository to your local machine using Git:
git clone https://github.com/PostgresCraft/encryption_service.git
cd encryption_service
- Make sure you have Git installed: https://git-scm.com
๐ฝ๏ธ Quick Clone of the Encryption Service Tools in action
Quick Start¶
1. Create Virtual Environment¶
# Windows
py -3.12 -m venv venv
.\env\Scripts\Activate
๐ฝ๏ธ Quick Windows of the Encryption Service Tools in action
# macOS / Linux
python3 -m venv venv
source venv/bin/activate
Optional: Upgrade pip (recommended)¶
Before installing dependencies, it's recommended to upgrade pip
to the latest version to avoid compatibility issues.
python -m pip install --upgrade pip
๐ฝ๏ธ Upgrading pip on Windows (recommended)
Install Dependencies¶
pip install -r requirements.txt
๐ฝ๏ธ Quick install of the Encryption Service Tools in action
Project Structure¶
The following is the current structure of the project files:
๐ธ Project file structure overview
๐ Click to view the text version
encryption_service/
โโโ encryption.py # Core encryption/decryption logic
โโโ keys_manager.py # Key generation and key handling
โโโ requirements.txt # List of dependencies
โโโ README.md # Project documentation
๐งช Integration Guide¶
Want to use encryption_service
inside other projects?
Here's how to integrate it in 3 simple steps...
- Import
keys_manager
andencryption
from the module. - Load or generate your encryption key.
- Use
encrypt()
anddecrypt()
wherever needed in your project.
โ Ready for PostgreSQL, APIs, Flask projects and more.
Brute-Force Simulation โ Why Fernet is Secure¶
The script brute_force_simulation.py
demonstrates the strength of Fernet encryption by attempting to decrypt a message using 100,000+ random keys.
As expected, none succeed โ showcasing the impracticality of brute-force attacks.
Fernet uses 256-bit symmetric keys. That means 2^256 possible keys, which is more than the number of atoms in the universe.
Brute-forcing such a key is computationally unfeasible.
โถ๏ธ Run the simulation:¶
py tests\brute_force_simulation.py
๐ฝ๏ธ It reinforces why using strong encryption like Fernet is essential.
License¶
This project is licensed under the MIT License.
See the LICENSE file for details.
Author¶
Tamer Hamad Faour
GitHub: @TamerOnLine