Skip to main content

Image Steganography


Table of Contents

  1. General Info
  2. Technologies
  3. Example
  4. FAQs

General Info


This project deals with hiding text message inside a image. Also called as Image Steganography. It is extremely useful technique for conceling text messages. In this project there are two function namely:

  • 'encode' which encode the entered text to an also image entered by a user.
  • 'decode' which decodes the text from the image which is previously encoded by the encode function.

Technologies


A list of libraries used within the project:

Example


Example to encode the text message to image

from ImageStega import ImageStega

image = ImageStega().encode(path, encode_text)

# path(str) : "path of the image" 
# encode_text(str) : "Text to be encoded in the image"

Example to decode the text from the image

from ImageStega import ImageStega

decoded_text = ImageStega().decode(path) 

# path(str) : path of the image which was previously encoded with the message.

FAQs


A list of frequenctly asked questions

  1. What is Image steganography?
    Steganography is the technique of hiding secret data within an ordinary, non-secret, file or message in order to avoid detection. More information can be found on this Wikipedia page.

  2. Where can I use this package?
    This tool is used to craftfully hide the data in images. So this package can be used to hide secret text messages by encoding them in images to maintain the secrecy.

  3. How does this algorithm works?
    Let us consider a 3 * 3 RBG image for understanding the algorithm. The image consists of 3 channel and heigh and weidth equal to 3. Thus 3 * 3 * 3 = 27 values, with each value ranging from 0-255(pixel value). For instance consider. We are interested in storing the character 'H' in this image. In the encode function the H is converted into binary value which is '01001000'. Each ASCII character can be represented by 8-bit binary number which is saved in the image.
    Consider 3 pixel values p1, p2 and p3 as (10,200,35), (26,65,98), (100,139,35) respectively.
    If the bit-value to be saved is 0 the pixel value is changed to even and if 1 its converted to odd. Thus in our example, the pixel value P1, P2 and P3 changes to (10,201,36), (26,65,98), (100,140,36). If the pixel value is odd but the value to be stored is 0, then the pixel value is increased by one. Same is the case with storing 1. In this way the txt message is stored in the form of 0s and 1s string in the image.
    In the decode function, the pixel values are erad one by one, and then if its odd it is taken as 1 else 0. This is done till the algorithm encounter STOP character. Once is encounters the STOP character, it terminates the program and returns the decoded text message.
    This STOP values is ~(tilda) in our case. So if your message consists of ~ character then the decoder will only read till that value. This is only drawback of this code.

  4. How many characters can I save in a image?
    Considering you have a RGB image with 1024 * 1024 resolution, you can encode upto (1024 * 1024 * 3 - 8) / 8 = 393215 characters. The 8 subtracted represents the bits reuiqred for STOP character.

Metadata

Release files for ImageStega 0.0.1

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

Source distribution (sdist)

Source distribution for ImageStega 0.0.1
File Size Uploaded Provenance Actions
ImageStega-0.0.1.tar.gz 5.1 kB Without provenance Details for ImageStega-0.0.1.tar.gz

Release files / ImageStega-0.0.1.tar.gz

Download URL ImageStega-0.0.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9652eab08e754413e7e370aa430b0b27df2b64c8bb54fa51d3c6cb12c8905b72
BLAKE2b-256 checksum
How to use checksums
38a38eb0009258cf7f528d27c0cfa8ff572bf450c873bde0f5004b464300cbe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Security for ImageStega 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

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