Image steganography

A Python tool that hides secret messages inside images using LSB steganography. Choose to encrypt or decrypt via a simple CLI, using lossless formats like PNG to safely conceal and reveal hidden text.

Python 3 Pillow (Python Imaging Library) Modular programming

Project Overview

This project is a Python-based steganography tool designed to conceal and extract text messages within image files. Using a simple and intuitive command-line interface, users can securely embed messages into standard image formats such as PNG or BMP. The process is entirely offline, requires no external services, and ensures that the visual quality of the image remains unchanged—making it ideal for discreet, secure communication in everyday files.

Key Features

Technical Implementation

This project is implemented in Python 3 and uses the Pillow library to handle image processing. It applies Least Significant Bit (LSB) steganography to hide text messages inside image files . The program works entirely through a command-line interface.
When encrypting, it takes a text message from the user and converts each character into its binary form. These binary bits are then embedded into the least significant bits of the image's RGB pixel values. An EOF marker, specifically the binary string 1111111111111110, is appended at the end of the message to indicate where the hidden content stops. During decryption, the tool reads the least significant bits of the image’s pixels and reconstructs the original message by converting the binary sequence back to text, stopping once the EOF marker is detected.
This approach works best with lossless image formats like PNG or BMP, as these preserve pixel values exactly. Lossy formats such as JPG are not suitable because compression can alter or remove the embedded data. The amount of text that can be hidden depends on the size of the image, since each pixel contributes three bits to storage capacity. The current implementation does not encrypt the message beyond simple embedding, and the presence of the EOF marker must be unique to avoid accidental early termination of the decoding process.