T.I.O. (Text Image Obfuscation) is a Python-based application that allows users to encrypt and decrypt images using a form of steganography. The application leverages random pixel generation to create an encryption key image and overlays an obfuscated text image on top of it. The encrypted image can then be decrypted using the same key image to reveal the hidden text. The application also provides an easy-to-use graphical user interface (GUI) for managing encryption and decryption workflows.
This tool is useful for hiding messages or sensitive information inside images in a visually non-obvious manner. But be aware that this might not be entirely safe.
- Encrypt Images: Select any image containing text and encrypt it with a randomly generated key image.
- Decrypt Images: Use the previously generated key image to reveal the hidden message.
- GUI: A simple GUI created with
tkinter. - Randomized Encryption: Each encryption generates a unique key, ensuring the output is distinct even when the same text image is used multiple times.
- Customizable Resolution: Users can set custom width and height for the output image resolution.
- You provide a text image (or images), and the app generates a random key image.
- The white background of the text image is made transparent, and the black pixels are replaced with random colors.
- The key image is then used as the base to overlay the modified text image, producing an encrypted image.
- The key image is saved as
key.png, and the encrypted images are saved in the current directory.
- To decrypt an image, the encrypted image and the corresponding key image must have the same dimensions.
- The app compares the encrypted image with the key image, revealing the hidden text by displaying it as black pixels on a white background.
- The decrypted image is saved in the current directory.
- Python 3.x
- numpy
- Pillow
- tkinter (included in the standard Python library)
To install the necessary dependencies, run the following command:
pip install numpy pillowgit clone https://github.com/stigsec/Text-Image-Obfuscation.git
cd Text-Image-ObfuscationRun the TIO.py script
python TIO.py- Run the script
- Under the "Settings" section, set the desired output resolution (width and height). Click Apply Settings to save changes.
- In the "Encrypt" section, click Select Images to choose one or more text images for encryption.
- After selecting the text images, click Encrypt to begin the encryption process.
- The app will generate a
key.pngfile and save the encrypted images asmessage_1.png,message_2.png, etc. - A message box will confirm the success of the operation and provide details on the output files.
- Run the script
- In the "Decrypt" section, click Select Encrypted Images to choose one or more previously encrypted images.
- Click Select Key Image to choose the
key.pngfile generated during encryption. - Once the encrypted images and key are selected, click Decrypt to reveal the hidden text.
- The decrypted images will be saved as
decrypted_1.png,decrypted_2.png, etc.
You can modify the following default settings within the script:
DEFAULT_WIDTH: Default output image width (set to 1280).DEFAULT_HEIGHT: Default output image height (set to 720).KEY_IMAGE_NAME: Name of the key image file (default is key.png).DEFAULT_TEXT_IMAGE_FORMAT: Format of the text image (set to png).DEFAULT_OUTPUT_IMAGE_FORMAT: Format of the encrypted and decrypted output images (set to png).
- The application ensures that the encrypted image and the key image must have the same dimensions for successful decryption.
- If the wrong image files are selected, an error message will be displayed.
- It provides feedback in case of incorrect width/height inputs or missing files during encryption and decryption processes.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.