A simple command-line tool for encrypting and decrypting images using Python's PIL library. This tool modifies the RGB values of each pixel in the image to achieve encryption and decryption.
The Image Encryption and Decryption Tool allows users to encrypt and decrypt images by modifying the RGB values of each pixel. The encryption adds a fixed value to each color component, and the decryption subtracts the same value to retrieve the original image.
- Encrypt Image: Add a fixed value to each color component of every pixel in the image.
- Decrypt Image: Subtract the same fixed value to retrieve the original image.
- User-friendly Interface: Simple menu-driven command-line interface.
- Python 3.x
- Pip (Python package installer)
-
Clone the repository:
git clone https://github.com/Anandkp21/PRODIGY_CS_TASK_02.git
-
Navigate to the project directory:
cd image-encryption-tool
-
Install required dependencies:
pip install -r requirements.txt
Alternatively, you can install dependencies individually:
pip install pillow
-
Run the image encryption tool:
python pixel.py
-
Choose an option from the menu:
- Enter
1
to upload and encrypt an image. - Enter
2
to decrypt an image. - Enter
3
to exit the tool.
- Enter
-
Follow the prompts:
- For encryption, enter the path to the image file you want to encrypt. The encrypted image will be saved as
encrypted_image.png
. - For decryption, enter the path to the encrypted image file. The decrypted image will be displayed.
- For encryption, enter the path to the image file you want to encrypt. The encrypted image will be saved as
$ python pixel.py
Choose an option:
1. Upload and Encrypt an image
2. Decrypt an image
3. Exit
Enter your choice (1/2/3): 1
Enter the path to the image file: path/to/your/image.png
Image encrypted successfully!
Encrypted image saved as: encrypted_image.png
$ python pixel.py
Choose an option:
1. Upload and Encrypt an image
2. Decrypt an image
3. Exit
Enter your choice (1/2/3): 2
Enter the path to the encrypted image file: encrypted_image.png
Image decrypted successfully!
This project is licensed under the MIT License. See the LICENSE file for details.