Skip to content

5062CEM-2223/11089706_CW1

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 7, 2023 17:49
November 7, 2023 17:49
November 7, 2023 17:49
November 7, 2023 17:55

11089706

CW1

Image Steganography with Python

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.

Features

  • 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.

Prerequisites

  • Python 3
  • OpenCV (cv2) library
  • NumPy library

Usage

  1. Clone the repository or download the code.
  2. 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.

Releases

No releases published

Languages