Skip to main content

Steganography in floating point data with NaN payloads

Project description

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.

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

steganan-0.2.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

steganan-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file steganan-0.2.1.tar.gz.

File metadata

  • Download URL: steganan-0.2.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for steganan-0.2.1.tar.gz
Algorithm Hash digest
SHA256 49721582a72a7a4db07d1f6a9b5cc29d5aa3b284c5169e3a13dc4cc5f4fb1073
MD5 e83a7c6825dbd2b97eb285d35efdabf9
BLAKE2b-256 db3463923bb1161cfedbc7746f1241b4bca367192ec007243b0b76c7a5ca1ca9

See more details on using hashes here.

File details

Details for the file steganan-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: steganan-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for steganan-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 910b18dc5ae43139871b8371c9f35e2b46a0bf40ef5d02511be19b31d616ac84
MD5 9dd82ee5ae6f56185a761d208f301a2c
BLAKE2b-256 9a32f771b48dcbc2eeff87c99a0bb11eeffcfee4000b81b30f3d2ec9d17d0cd7

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