A Python implementation of Honey Encryption with AI-powered decoy generation and secure communication capabilities.
Honey Encryption is a security technique that provides plausible deniability by generating multiple decoy messages that appear equally valid when decrypted with incorrect keys. This makes it extremely difficult for attackers to determine which message is the real one, even if they gain access to the encrypted data.
- Advanced Encryption: Uses AES-256 encryption with PBKDF2 key derivation
- AI-Powered Decoys: Generates realistic decoy messages using Google's Gemini AI
- Plausible Deniability: Multiple decoy messages make it impossible to distinguish the real message
- GUI Interface: User-friendly Tkinter-based application for encryption/decryption
- Network Communication: Secure TCP-based chat application with encrypted messaging
- File Transfer: Encrypted file sharing capabilities
- Cross-Platform: Works on Windows, macOS, and Linux
- HE_algo.py - Core Honey Encryption algorithm implementation
- gen_ai_single.py - AI-powered decoy message generation using Gemini API
- index.py - GUI application for standalone encryption/decryption
- HE_index.py - Programmatic interface for encryption/decryption
- TCP_server.py - Multi-client chat server with file sharing
- TCP_client.py - Chat client with encrypted messaging
- PBKDF2 Key Derivation: 100,000 iterations with SHA-256
- AES-256 Encryption: CFB mode with random IV
- Random Salt Generation: 16-byte salt for each encryption
- AI-Generated Decoys: Realistic sentences that match original message length
- Base64 Encoding: Safe transmission of binary data
- Python 3.7 or higher
- Internet connection (for AI decoy generation)
-
Clone the repository
git clone https://github.com/code-razz/Honey-Encryption cd Honey-Encryption -
Install dependencies
pip install cryptography python-dotenv google-generativeai
-
Configure AI API (for decoy generation)
- Create a
.envfile in the project root - Add your Gemini API key:
GEMINI_API_KEY=your_api_key_here - Get your API key from Google AI Studio
- Create a
Run the GUI application:
python index.pyFeatures:
- Enter your password/key
- Input text for encryption or paste ciphertext for decryption
- View encrypted data or decrypted messages
- All decoy messages are displayed when decrypting
from HE_index import encrypt_message, decrypt_message
# Encrypt a message
password = "your_secret_password"
message = "This is a secret message"
encrypted_data = encrypt_message(password, message)
# Decrypt the message
decrypted_messages = decrypt_message(password, str(encrypted_data))
real_message = decrypted_messages[0] # First message is the real oneStart the server:
python TCP_server.pyStart a client:
python TCP_client.pyFeatures:
- Real-time encrypted messaging
- File sharing with encryption
- Multi-client support
- Automatic message decryption
Edit TCP_server.py to change server settings:
server = Server(host='0.0.0.0', port=5000)Edit TCP_client.py to connect to your server:
client = Client(host='192.168.31.77', port=5000)Change the default password in TCP_client.py:
HE_password = "your_custom_password"Run the test file to verify functionality:
python test.pyHoney-Encryption-main/
├── HE_algo.py # Core encryption algorithm
├── gen_ai_single.py # AI decoy generation
├── index.py # GUI application
├── HE_index.py # Programmatic interface
├── TCP_server.py # Chat server
├── TCP_client.py # Chat client
├── test.py # Test file
├── README.md # This file
└── not_used/ # Unused/experimental files
├── conn.py
├── index copy.py
└── TCP_socket.py
- API Key Error: Ensure your
.envfile contains the correct Gemini API key - Connection Refused: Check if the server is running and the IP/port is correct
- Import Errors: Make sure all dependencies are installed
- Decryption Failures: Verify the password matches the one used for encryption
Built with ❤️ using Python, Cryptography, and Google Gemini AI by Raj Sah (https://github.com/code-razz)