Stegonography utilities
Project description
stegonosaurus
Ver 1.2.3
Steganography functions packed in a convenient wheel. This library helps encode and decode messages into and out of multi-band .png images. Works with the Image module of the Pillow library.
Requirements
- Python3
Installing
A simple pip install will do:
pip install stegonosaurus
Functions
inspect (img: PIL.Image) -> str:
Returns a string that contains the values of each pixel in the image along with other relevant info such as image size, format, file name, mode, and whether it can be used with the other functions in the library or not.
black (img: PIL.Image) -> PIL.Image:
Return an all black copy of a provided image. This helps create a template for images with coded messages used for encoding.
decode (img: PIL.Image, mode: str) -> PIL.Image:
Decodes an image with a hidden message. This functions looks for pixels where the blue value is odd, and paints those pixels bright red. This function operates on two modes:
-B,b (for "black"): pixels with an even blue value are colored black, displaying the message in red letters on a black background. -T,t (for "transparent"): pixels with an odd blue value are colored red, the other pixels remain the same so the message can be displayed on top of the original image.
encode (coded: PIL.Image, img: PIL.Image) -> PIL.Image:
Takes two images, a black image with a message in contrasting colors, and the image where the message will be encoded. The image where the message is going to be hidden in is first "flattened" (all pixels with an odd value on their blue component are changed so their blue component's value is even). Afterwards, the image that contains the message is processed, so the same pixels that contain the bright red letters are changed in the other image to pixels where the blue value is odd (harder to express in theory than practice). The image with the bright message has to be smaller or equal in size to the image where the message is going to be hidden in on either axis.
Exceptions:
-
StegonosaurusIncorrectFormatError:
Raised when a function receives a file that isn't a .PNG multiband image.
-
StegonosaurusIncorrectSizeError:
Raised when the image with the coded message is larger than the image where the message will be hidden.
-
StegonosaurusInvalidDecodeModeError (Ver. 1.1.3):
Raised when an invalid decode mode is provided.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stegonosaurus-1.2.3.tar.gz
.
File metadata
- Download URL: stegonosaurus-1.2.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eab7e054ae211237980c9a61758960c3683f73376e7c4bbdd7c867ed92ddab48 |
|
MD5 | 11982708149c564ae0d96bdba1cd03fc |
|
BLAKE2b-256 | 6203acd3baacc55f81011f057f92ca74a5229c02b9a60e84dcea293bb2f983d6 |
File details
Details for the file stegonosaurus-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: stegonosaurus-1.2.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec6e9958008f86f1b42e00e06fca316b5fcde554d23995066d3ee692ec46facd |
|
MD5 | b782b3ad6248837588139e2ba60b4765 |
|
BLAKE2b-256 | 1dbb5880a42694ffbeb47e14d38b98c74aed0611cc9780d45c2e8df28b820b87 |