Skip to content

ZianElijahSmith/Python_Stenography_Functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python_Stenography_Functions

At the moment, this repository has 3 python functions to do stenography on .png files with no alpha channel and in RGB mode.

embed(path_to_file, message)
decode(path_to_file)
erase(path_to_file)

I plan to add some more later and this repo is a living repo. Notes and URLs will be added to aid the reader in learning about stenography.

The purpose of this repository is to both provide useful functions, and to teach coders about stenography.

Release Notes

The (PNG + RGB + Image Channels == 3) test worked! Tested on Python 3.7.3 (default, Oct 31 2022, 14:04:00) \n[GCC 8.3.0]) The code was tested on the following image on this URL: https://upload.wikimedia.org/wikipedia/commons/6/6a/PNG_Test.png

Screenshot of successful test is below

Learning Notes

  1. PNG files tend to be easier to work with than JPG because PNG has "lossless compression".
  2. This code works for images with three channels.
    you can check how many channels an image has with:
    from PIL import Image
    img = Image.open(path_to_file)
    print(img.size)
    print(len(img.getbands()))

    If the len(img.getbands()) is 4, the image has an "alpha channel"
    Read this URL to learn more of what an "alpha channel" is:
    https://www.makeuseof.com/tag/alpha-channel-images-mean/

  3. max_message_length = (img.size[0] * img.size[1] * 3) // 8
  4. The png image must be in RGB mode
    Read this URL to learn more:
    https://www.howtogeek.com/42393/rgb-cmyk-alpha-what-are-image-channels-and-what-do-they-mean/

Learning Resources

    Websites

  1. Steganography Online - https://stylesuxx.github.io/steganography/
  2. Digital Invisible Ink Toolkit - http://diit.sourceforge.net/
  3. OpenStego - https://www.openstego.com/
  4. Steganography Studio - http://www.outguess.org/detection.php
  5. Steganography Wiki - https://en.wikipedia.org/wiki/Steganography
  6. Image Based Stenography with Python - https://www.geeksforgeeks.org/image-based-steganography-using-python/

    Books:

  1. "Steganography in Digital Media: Principles, Algorithms, and Applications" by Jessica Fridrich, Miroslav Goljan, and Dorin Hogea
  2. "Steganography: Techniques and Applications" by Arun Kumar Singh and Shivendra Singh
  3. "Applied Cryptography: Protocols, Algorithms, and Source Code in C" by Bruce Schneier
  4. "Information Hiding: Steganography and Watermarking - Attacks and Countermeasures" by Neil F. Johnson, Zoran Duric, and Sushil Jajodia
  5. "Handbook of Information and Communication Security" by Peter Stavroulakis and Mark Stamp

Speical Thanks

Thank you to Pillow! https://pillow.readthedocs.io/en/stable/

About

This repository contains simple Python functions for Stenography.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages