CW1
This Python code allows you to perform image steganography, a technique to hide text messages within image files. You can either encode a text message into an image or decode a hidden message from an encoded image.
- Encoding: You can hide a text message within an image of your choice. The encoded image will be saved with the secret message hidden inside.
- Decoding: You can retrieve the hidden text message from an encoded image.
- Python 3
- OpenCV (cv2) library
- NumPy library
- Clone the repository or download the code.
- Make sure you have the required libraries installed. You can install them using pip:
pip install opencv-python numpy
## Running the Software
1. Run the main.py file:
python main.py
2. You'll be prompted to choose between encoding (1) and decoding (2). Select your choice.
Encoding
If you choose encoding (1):
• Enter the image path with the extension (e.g., img.png).
• Enter the text you would like to encode.
• The encoded image will be saved with the hidden message inside.
Decoding
If you choose decoding (2):
• Enter the path of the encoded image (e.g., encoded.png).
• The hidden message will be extracted and displayed.
Notes
• The code uses the least significant bits (LSB) of the image's color channels to hide the
text.
• It uses a delimiter ("@@@@") to identify the end of the hidden message while
decoding.
• Be sure to choose an image with enough capacity to hide your text. Larger images can
hide longer messages.