This Python implementation demonstrates a basic image encryption algorithm using the XOR cipher technique. It employs symmetric key cryptography, where identical keys are used for both encryption and decryption operations.
- 📁 The program prompts users for the image file path to be encrypted
- 🔑 Users must provide a numerical encryption key for the XOR operation
- 📂 Opens the target image in read-binary mode (
'rb') - 📊 Reads the complete image content into memory
- 🔄 Converts image data into a byte array for byte-level manipulation
- ⚙️ Performs a bitwise XOR operation on each byte using the provided encryption key
- 🔀 The XOR operation effectively scrambles the image data by flipping bits according to the key pattern
- 💾 Writes the encrypted byte array back to the original file location
- ✅ Displays a confirmation message upon successful encryption
⚠️ This represents a basic encryption implementation; more sophisticated algorithms are recommended for high-security applications- 🔄 Decryption requires performing the XOR operation again with the identical key
- 🛡️ The current implementation lacks robust error handling mechanisms
- 💡 Future improvements could include validation for file paths and encryption key inputs
# Clone this repository
git clone https://github.com/soheilsheikh/PRODIGY_CS_02.git
# Navigate to the project directory
cd PRODIGY_CS_02
# Run the encryption script
python encrypt.py
