Skip to main content

A Python library for image steganography using LSB encoding

Project description

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 LSB
  • decode_lsb(img_path) - Decode message using LSB
  • encode_dct(img_path, message, output_path, block_size=8) - Encode using DCT
  • decode_dct(img_path, block_size=8) - Decode using DCT
  • detect_hidden_data(img_path, method='decode') - Detect hidden data
  • calculate_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.

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

ghostbit-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghostbit-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ghostbit-0.1.0.tar.gz.

File metadata

  • Download URL: ghostbit-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ghostbit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6153d7c9ddcddc736e0a590663af56325a77a7b6a1fe65b5ed2ff5a1c127dfda
MD5 befd497c9a4acee2c66954748f0658ff
BLAKE2b-256 e95ebb0e34d4cbc91fd65a29e1b4ccae50d93f014338a42eae21e73231e905ad

See more details on using hashes here.

File details

Details for the file ghostbit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ghostbit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ghostbit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d26eeacef6d2a57a6f1df6280687e384d12d754cfed7069173fdac0cea62f6d8
MD5 26b36d761e09b9133b5e84f82a8de362
BLAKE2b-256 32f4076e29abd66fe88731136a19e3f97ff5f05568f3f153c52c192f96a8b652

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page