Documentation ¶
Overview ¶
Package steganography is a library that provides functions to execute steganography encoding and decoding in a given image. It is also able to check the maximum encoding size, and the size of an encoded message.
Index ¶
- func Decode(msgLen uint32, pictureInputFile image.Image) (message []byte)
- func Encode(writeBuffer *bytes.Buffer, pictureInputFile image.Image, message []byte) error
- func EncodeNRGBA(writeBuffer *bytes.Buffer, rgbImage *image.NRGBA, message []byte) error
- func GetMessageSizeFromImage(pictureInputFile image.Image) (size uint32)
- func MaxEncodeSize(img image.Image) uint32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode gets messages from pictures using LSB steganography, decode the message from the picture and return it as a sequence of bytes It wraps EncodeNRGBA making the conversion from image.Image to image.NRGBA
Input: msgLen uint32 : size of the message to be decoded pictureInputFile image.Image : image data used in decoding Output: message []byte decoded from image
func Encode ¶
Encode encodes a given string into the input image using least significant bit encryption (LSB steganography) The minnimum image size is 23 pixels It wraps EncodeNRGBA making the conversion from image.Image to image.NRGBA
Input: writeBuffer *bytes.Buffer : the destination of the encoded image bytes message []byte : byte slice of the message to be encoded pictureInputFile image.Image : image data used in encoding Output: bytes buffer ( io.writter ) to create file, or send data.
func EncodeNRGBA ¶
EncodeNRGBA encodes a given string into the input image using least significant bit encryption (LSB steganography) The minnimum image size is 24 pixels for one byte. For each additional byte, it is necessary 3 more pixels.
Input: writeBuffer *bytes.Buffer : the destination of the encoded image bytes pictureInputFile image.NRGBA : image data used in encoding message []byte : byte slice of the message to be encoded Output: bytes buffer ( io.writter ) to create file, or send data.
func GetMessageSizeFromImage ¶
GetMessageSizeFromImage gets the size of the message from the first four bytes encoded in the image
func MaxEncodeSize ¶
MaxEncodeSize given an image will find how many bytes can be stored in that image using least significant bit encoding ((width * height * 3) / 8 ) - 4 The result must be at least 4,
Types ¶
This section is empty.