go-steg
is a package that allows you to embed images inside other images using Least Significant Bit manipulation.
This is a form of steganography,
which is the practice of hiding information in plain sight.
This package also allows you to embed an image with the use of a password.
This is used to generate
an indiscernibility mask
that allows the image to be embedded in a way that makes it tough (to potentially impossible) to detect
by common steganography detection (also termed "steganalysis") tools.
Here's a list of useful tools for steganography in general, including detection:
Steganography Tools.
The impetus for writing this tool was to explore and learn more about steganography, and to see how it could be used in a practical way. At the time of writing, there also were few Go-based tools for steganography, so this was a good opportunity to contribute to the Go community.
Moving forward, the goal is to primarily allow for the embedding of images into "carrier" images that then can be uploaded to image sharing sites. This would allow for the sharing of images that contain other images, which could be used for a variety of purposes.
- Clone down the repository
- Run
go install
to install the package (currently using Go 1.20) - Run
go-steg
to see the help menu
Photo by Daniel J. Schwarz on Unsplash
Photo by Daniel J. Schwarz on Unsplash
- Use
go install
to install the package.
Some background on images:
- Digital images are typically made up of pixels.
- Each pixel has different color channels - your general RGBA digital image has 4 channels, one each for Red, Green, Blue, and Alpha (transparency).
- Each channel is typically represented by a byte, so each pixel is 4 bytes.
- When you see a color written out as (255, 0, 0, 255), that's the RGBA representation of the color red. The first 3 bytes are the RGB values, and the last byte is the alpha value.
- The alpha value is typically 255 for opaque images, but can be anything from 0 to 255. 0 is completely transparent, and 255 is completely opaque.