Skip to main content

Implementation of modern image steganographic algorithms

Project description

PyPI version Commit CI/CD Release CI/CD Documentation Status PyPI downloads Stars Contributors Wheel Status PyPi license Last commit

conseal

Python package, containing implementations of modern image steganographic algorithms.

:warning: The package only simulates the embedding, which is useful for steganalysis research. We do not provide any end-to-end steganography method.

Installation

Simply install the package with pip3

pip3 install conseal

or using the cloned repository

git clone https://github.com/uibk-uncover/conseal/
cd conseal
pip3 install .

Contents

Steganography method Domain Reference
nsF5: no-shrinkage F5 JPEG Original F5 algorithm, no-shrinkage extension
EBS: entropy block steganography JPEG Reference
UERD: uniform embedding revisited distortion JPEG Reference
J-UNIWARD: JPEG-domain universal wavelet relative distortion JPEG Reference

Usage

Import the library in Python 3

import conseal as cl

This package currently contains the three JPEG steganography methods J-UNIWARD, UERD, and nsF5. The following examples show how to embed a JPEG cover image cover.jpeg with an embedding rate of 0.4 bits per non-zero AC coefficient (bpnzAC):

  • J-UNIWARD
# load cover
im_spatial = jpeglib.read_spatial("cover.jpeg", jpeglib.JCS_GRAYSCALE)
im_dct = jpeglib.read_dct("cover.jpeg")

# embed J-UNIWARD 0.4
im_dct.Y = cl.juniward.simulate_single_channel(
    cover_spatial=im_spatial.spatial[..., 0],
    cover_dct_coeffs=im_dct.Y,
    quantization_table=im_dct.qt[0],
    embedding_rate=0.4,
    seed=12345
)

# save result as stego image
im_dct.write_dct("stego.jpeg")
  • UERD
# load cover
im_dct = jpeglib.read_dct("cover.jpeg")

# embed UERD 0.4
im_dct.Y = cl.uerd.simulate_single_channel(
    cover_dct_coeffs=im_dct.Y,
    quantization_table=im_dct.qt[0],
    embedding_rate=0.4,
    seed=12345
)

# save result as stego image
im_dct.write_dct("stego.jpeg")
  • nsF5
# load cover
im_dct = jpeglib.read_dct("cover.jpeg")

# embed nsF5 0.4 bpnzAC
im_dct.Y = cl.nsF5.simulate_single_channel(
    cover_dct_coeffs=im_dct.Y,
    embedding_rate=0.4,
    seed=12345
)

# save result as stego image
im_dct.write_dct("stego.jpeg")
  • EBS
# load cover
im_dct = jpeglib.read_dct("cover.jpeg")

# embed EBS 0.4 bpnzAC
im_dct.Y = cl.ebs.simulate_single_channel(
    cover_dct_coeffs=im_dct.Y,
    quantization_table=im_dct.qt[0],
    embedding_rate=0.4,
    seed=12345
)

# save result as stego image
im_dct.write_dct("stego.jpeg")
  • HUGO
# load cover
cover_spatial = np.array(Image.open("cover.png"))

# embed HUGO 0.4 bpnzAC
stego_spatial = cl.hugo.simulate_single_channel(
    cover_spatial=cover_spatial,
    embedding_rate=0.4,
    seed=12345)

# save result as stego image
Image.fromarray(stego_spatial).save("stego.png")
  • HILL
# load cover
cover_spatial = np.array(Image.open("cover.png"))

# embed HUGO 0.4 bpnzAC
stego_spatial = cl.hill.simulate_single_channel(
    cover_spatial=cover_spatial,
    embedding_rate=0.4,
    seed=12345)

# save result as stego image
Image.fromarray(stego_spatial).save("stego.png")

Acknowledgements and Disclaimer

Developed by Martin Benes and Benedikt Lorch, University of Innsbruck, 2023.

The J-UNIWARD and nsF5 implementations in this package are based on the original Matlab code provided by the Digital Data Embedding Lab at Binghamton University. We also thank Patrick Bas and Rémi Cogranne for sharing their implementations of UERD and EBS with us.

We have made our best effort to ensure that our implementations produce identical results as the original Matlab implementations. However, it is the user's responsibility to verify this.

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

conseal-2024.9.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

conseal-2024.9-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file conseal-2024.9.tar.gz.

File metadata

  • Download URL: conseal-2024.9.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for conseal-2024.9.tar.gz
Algorithm Hash digest
SHA256 7b70804fe2a55ced8a2e76c42d26cbeaf8f2283f518c9255c1e310d151e0e589
MD5 769688e099cba417eacc63c8978d4d77
BLAKE2b-256 0dedb1369d66ca082717faa4e9822fc69c620a807c0d18abcecf04735d9bfdac

See more details on using hashes here.

File details

Details for the file conseal-2024.9-py3-none-any.whl.

File metadata

  • Download URL: conseal-2024.9-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for conseal-2024.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b3eaa2f57f602bb108d9101475e61147fdadde01044ffa058e36e2ec39263e
MD5 ca54b1e9103a64afcb7b967f3aa5501f
BLAKE2b-256 857905a02775b0589a1f2949f87c5708769b31d8e96d80fb14d3b47912e0c238

See more details on using hashes here.

Supported by

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