Skip to main content

steganan

PyPI - Version Release Build status License

Steganography in floating point data with NaN payloads

Do you have not-a-number values in your floating point data that you're not making full use of? Have you ever pondered what to do with all of those wasted bits? Steganan may be for you! Encode whatever data you like into those spare bits! Most programs won't even notice the difference. Save them out to a file if you like. As long as your file format preserves the full floating point values, you can get your hidden data back!

Want to add compression and/or encryption of your data? That is certainly possible, but is left as an exercise for the user.

Examples

Storing image data in an array of NaN values

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> from skimage.data import astronaut
>>> import steganan
>>> img = astronaut()
>>> print(img.shape)
(512, 512, 3)
>>> a = steganan.encode_array(img, stack=True, dtype=np.float64)
>>> print(a)
[[nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 ...
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]]
>>> decoded = steganan.decode_array(a, stack=True, depth=3)
>>> plt.figure(figsize=(4, 4))
>>> plt.imshow(decoded)

decoded.png

Hiding data in an existing floating point array

>>> import rasterio as rio
>>> src = rio.open("data/modis_aod_06_2025.tif")
>>> a = src.read(1)
>>> steganan.write_str_to_nans(a, "I have a secret!")
>>> plt.imshow(a, cmap='inferno_r', vmin=0, vmax=1.0)

encoded.png

>>> message = steganan.retrieve_string_from_payloads(a)
>>> print(message)
I have a secret!

Notebook example

See lightning talk slides.


Repository initiated with fpgmaas/cookiecutter-uv.

Release files for steganan 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for steganan 0.2.2
File Size Uploaded
steganan-0.2.2.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for steganan 0.2.2
File Interpreter ABI Platform
steganan-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / steganan-0.2.2.tar.gz

Download URL steganan-0.2.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ec46eae6189b247448b8bd6f3cef03c211c41db5b67388ea1535bef4d18131e9
BLAKE2b-256 checksum
How to use checksums
a2b42815dcf14012cfe2ec51599c89b8eeed2b85717d702bedd15f7c6c9314d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / steganan-0.2.2-py3-none-any.whl

Download URL steganan-0.2.2-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c1f8b7d5e6e7a7f909c709a01a73d6067245bb7a9c75fc8effa516ae4d69f3c
BLAKE2b-256 checksum
How to use checksums
bd4048e7d117b4afef5cba6f9824cbbf479bc1ff3a6242df1c257ced23910439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page