A steganography library with cryptography for hiding messages in images.
Project description
stega-crypt
A steganography tool for securely hiding messages within images.
Overview
This tool combines steganography and cryptography to provide a secure way to hide sensitive messages within image files. Using the Least Significant Bit (LSB) technique, it embeds data in image pixels with minimal visual impact, while offering optional encryption and compression.
Features
- Message Hiding: Embed text messages inside image files using LSB steganography
- Message Extraction: Extract hidden messages from modified images
- AES Encryption: Optional AES-GCM encryption on the hidden message for enhanced security
- Data Compression: Automatic compression when beneficial
- CLI Interface: Easy-to-use command-line interface
- Noise Addition: Random noise addition to unused bits for better security
Installation
Install Stega-Crypt directly from PyPI:
pip install stega-crypt
Usage
stega-crypt provides a simple command-line interface with the following commands:
Get Information About the Tool
stega-crypt about
Hide a Message in an Image
# Hide a direct message
stega-crypt encode image.png --message "This is a secret message"
# Hide a message from a text file
stega-crypt encode image.png --message-path secret.txt
# Hide a message with compression
stega-crypt encode image.png --message "Secret message" --compress
# Hide a message with encryption
stega-crypt encode image.png --message "Secret message" --encrypt
# Hide a message with custom output path and filename
stega-crypt encode image.png --message "Secret message" --output-path /path/to/folder --image-name image-secret
Extract a Message from an Image
# Extract and display a message
stega-crypt decode image-secret.png
# Extract a message and save to file
stega-crypt decode image-secret.png --save-message
# Extract an encrypted message
stega-crypt decode image-secret.png --decrypt
# Extract a message with custom output path and filename
stega-crypt decode image-secret.png --save-message --output-path /path/to/folder --message-name extracted
Verbosity Options
You can increase output verbosity using the -v or --verbosity option:
stega-crypt -v encode image.png --message "Secret message" # Informational messages
stega-crypt -vv encode image.png --message "Secret message" # Debug messages
How It Works
-
Encoding Process:
- If compression is requested, the message is optionally compressed if it reduces size
- If encryption is requested, the message is encrypted using AES-GCM with a password-derived key
- The message is converted to binary and embedded in the least significant bits of image pixels
- Random noise is added to unused LSBs to make detection more difficult
- The modified image is saved to the specified location
-
Decoding Process:
- The LSB of each pixel is extracted from the image
- The binary message is rebuilt and converted back to text
- If compression was used, the message is decompressed
- If encryption was used, the message is decrypted using the provided password
- The message is displayed or saved to a file
Security Features
- AES-GCM Encryption: Military-grade encryption with authentication
- PBKDF2 Key Derivation: Secure password-to-key derivation with salt
- LSB Steganography: Visually imperceptible changes to the image
- Random Noise: Addition of random bit flipping in unused LSBs to deter statistical analysis
- Data Compression: Optional compression to reduce the steganographic footprint
Requirements
- Python 3.10+
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stega_crypt-1.0.tar.gz.
File metadata
- Download URL: stega_crypt-1.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d726818fb9d0c89f191c223cb566c077971514388e0c696b83b2119397c46b1
|
|
| MD5 |
de23977687e02273453062e05fb620a1
|
|
| BLAKE2b-256 |
6ed5873b990f14a40882206011381df75091cbeb150444aa2076e9457f40ca3c
|
Provenance
The following attestation bundles were made for stega_crypt-1.0.tar.gz:
Publisher:
release.yaml on Luca-02/stega-crypt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stega_crypt-1.0.tar.gz -
Subject digest:
8d726818fb9d0c89f191c223cb566c077971514388e0c696b83b2119397c46b1 - Sigstore transparency entry: 189938342
- Sigstore integration time:
-
Permalink:
Luca-02/stega-crypt@817a00cdbfc46134623fe0e539d2d057ea3ffe87 -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/Luca-02
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@817a00cdbfc46134623fe0e539d2d057ea3ffe87 -
Trigger Event:
release
-
Statement type:
File details
Details for the file stega_crypt-1.0-py3-none-any.whl.
File metadata
- Download URL: stega_crypt-1.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
933b5c4e3bea9efa5ea310e92bddc8e5fdda7a226c5600be623c3579f01a842f
|
|
| MD5 |
faab8504c35acab98f369d85ab7ddc1b
|
|
| BLAKE2b-256 |
188a93acc7b377283f144a28cb73ea1f3953f365718eb839fd75983be83c17c9
|
Provenance
The following attestation bundles were made for stega_crypt-1.0-py3-none-any.whl:
Publisher:
release.yaml on Luca-02/stega-crypt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stega_crypt-1.0-py3-none-any.whl -
Subject digest:
933b5c4e3bea9efa5ea310e92bddc8e5fdda7a226c5600be623c3579f01a842f - Sigstore transparency entry: 189938343
- Sigstore integration time:
-
Permalink:
Luca-02/stega-crypt@817a00cdbfc46134623fe0e539d2d057ea3ffe87 -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/Luca-02
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@817a00cdbfc46134623fe0e539d2d057ea3ffe87 -
Trigger Event:
release
-
Statement type: