Documentation ¶
Overview ¶
Package steg provides a complete steganography toolkit for storage and retrieval of data within images.
Index ¶
Constants ¶
const ( // VersionMax is the primary version component of the package. VersionMax uint8 = 0 // VersionMid is the secondary version component of the package. VersionMid uint8 = 9 // VersionMin is the tertiary version component of the package. VersionMin uint8 = 0 )
Variables ¶
This section is empty.
Functions ¶
func Dig ¶
func Dig(config *DigConfig, outputLevel OutputLevel) error
Dig extracts the binary data of a file from a provided image on disk, and saves the result to a new file. The configuration must perfectly match the one used in encoding in order to extract successfully.
func Hide ¶
func Hide(config *HideConfig, outputLevel OutputLevel) error
Hide hides the binary data of a file in a provided image on disk, and saves the result to a new image. It has the option of using one of several different encoding algorithms, depending on user needs.
Types ¶
type BadHeaderError ¶
type BadHeaderError struct{}
BadHeaderError is thrown when the read header is garbage. Likely caused by a bad configuration or source image.
func (*BadHeaderError) Error ¶
func (e *BadHeaderError) Error() string
Error returns a string that explains the BadHeaderError.
type DigConfig ¶
type DigConfig struct { // ImagePath is the path on disk to a supported image. ImagePath string // OutPath is the path on disk to write the output image. OutPath string // PatternPath is the path on disk to the pattern file used in decoding. PatternPath string // Algorithm is the algorithm to use in the operation. Algorithm algos.Algo // MaxCorrectableErrors is the number of bit errors to be able to correct for per file chunk. Setting it to 0 disables bit ECC. MaxCorrectableErrors uint8 // MaxBitsPerChannel is the maximum number of bits to write per pixel channel. // The minimum of this and the supported max of the image format is used. MaxBitsPerChannel uint8 // DecodeAlpha is whether or not to decode the alpha channel. DecodeAlpha bool // DecodeMsb is whether to decode the most-significant bits instead - mostly for debugging. DecodeMsb bool }
DigConfig stores the configuration options for the Dig operation.
type HideConfig ¶
type HideConfig struct { // ImagePath is the path on disk to a supported image. ImagePath string // FilePath is the path on disk to the file to hide. FilePath string // OutPath is the path on disk to write the output image. OutPath string // PatternPath is the path on disk to the pattern file used in encoding. PatternPath string // Algorithm is the algorithm to use in the operation. Algorithm algos.Algo // MaxCorrectableErrors is the number of bit errors to be able to correct for per file chunk. Setting it to 0 disables bit ECC. MaxCorrectableErrors uint8 // MaxBitsPerChannel is the maximum number of bits to write per pixel channel. // The minimum of this and the supported max of the image format is used. MaxBitsPerChannel uint8 // DecodeAlpha is whether or not to encode the alpha channel. EncodeAlpha bool // EncodeMsb is whether to encode the most-significant bits instead - mostly for debugging. EncodeMsb bool }
HideConfig stores the configuration options for the Hide operation.
type InsufficientHidingSpotsError ¶
type InsufficientHidingSpotsError struct { // Additional information about the problem. AdditionalInfo string // An inner error involved in the issue to provide more information. InnerError error }
InsufficientHidingSpotsError is thrown when the provided image does not have enough room to hide the provided file using the provided configuration.
func (*InsufficientHidingSpotsError) Error ¶
func (e *InsufficientHidingSpotsError) Error() string
Error returns a string that explains the InsufficientHidingSpotsError.
type InvalidFormatError ¶
type InvalidFormatError struct { // A description of the problem. If empty, a default message is used. ErrorDesc string }
InvalidFormatError is thrown when provided data is of an invalid format.
func (InvalidFormatError) Error ¶
func (e InvalidFormatError) Error() string
Error returns a string that explains the InvalidFormatError.
type OutputLevel ¶
type OutputLevel int
OutputLevel is used to define the levels of output supported by the package.
const ( // OutputNothing tells the package to be completely quiet. OutputNothing OutputLevel = iota // OutputSteps tells the package to print operation progress at each significant step of the process. OutputSteps OutputLevel = iota // OutputInfo tells the package to print operation progress at each significant step of the process, and include additional information. OutputInfo OutputLevel = iota // OutputDebug tells the package to print formatted debug information in addition to everything else. OutputDebug OutputLevel = iota )
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
algos
Package algos implements the set of supported algorithms for the package github.com/zedseven/steg.
|
Package algos implements the set of supported algorithms for the package github.com/zedseven/steg. |
util
Package util provides some basic utility functions.
|
Package util provides some basic utility functions. |