Ghostbit
A Python library for image steganography using LSB (Least Significant Bit) encoding.
Features
- LSB Steganography: Encode and decode secret messages in images using the Least Significant Bit method
- DCT Steganography: Alternative encoding method using Discrete Cosine Transform
- Image Analysis: Detect hidden data and calculate image quality metrics
Installation
pip install ghostbit
Or install from source:
cd ghostbit-py
pip install -e .
Quick Start
from ghostbit import encode_lsb, decode_lsb
# Encode a message into an image
encode_lsb("cover_image.png", "secret message", "stego_image.png")
# Decode a message from an image
message = decode_lsb("stego_image.png")
print(message) # Output: secret message
Usage Examples
Basic Encoding/Decoding
from ghostbit import encode_lsb, decode_lsb
# Encode a secret message
encode_lsb("input.png", "My secret password", "output.png")
# Decode the message
secret = decode_lsb("output.png")
API Reference
Steganography Functions
encode_lsb(img_path, message, output_path)- Encode message using LSBdecode_lsb(img_path)- Decode message using LSBencode_dct(img_path, message, output_path, block_size=8)- Encode using DCTdecode_dct(img_path, block_size=8)- Decode using DCTdetect_hidden_data(img_path, method='decode')- Detect hidden datacalculate_psnr(img1_path, img2_path)- Calculate PSNR between images
Requirements
- Python >= 3.8
- Pillow >= 10.0.0
- numpy >= 1.24.0
- scipy >= 1.10.0
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for ghostbit 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ghostbit-0.2.0.tar.gz | 6.6 kB | With provenance | Details for ghostbit-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ghostbit-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ghostbit-0.2.0-py3-none-any.whl |
Total release size: 13.7 kB
Release files / ghostbit-0.2.0.tar.gz
| Download URL | ghostbit-0.2.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
938c768e676d7d1abf68ca0585430534d16fef67a1177af9c6435b8449f27942
|
|
BLAKE2b-256 checksum How to use checksums |
20972f54d0f93573fc1567c764abdd36cbe6b66855708dcbe659952564be06aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.
Transparency logRelease files / ghostbit-0.2.0-py3-none-any.whl
| Download URL | ghostbit-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19665463955fb10f5fdc04a16f780d32fa472b71158b2ebda30357d2182f3213
|
|
BLAKE2b-256 checksum How to use checksums |
8b63267309eef2aeca6838904ae19b472fe5d9aedfce772dbf11447327a3337d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.
Transparency logSecurity for ghostbit 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ghostbit-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.