Steganography
A C++ Steganography tool which leverages the LSB and DCT embedding techniques
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LeastSignificantBit Class Reference
Inheritance diagram for LeastSignificantBit:
Inheritance graph
Collaboration diagram for LeastSignificantBit:
Collaboration graph

Public Member Functions

 LeastSignificantBit (const boost::filesystem::path &image_path)
 
void Encode (const boost::filesystem::path &)
 
void Decode ()
 
- Public Member Functions inherited from Steganography
 Steganography (const boost::filesystem::path &image_path)
 

Private Member Functions

void EncodeChunk (const int &start, std::vector< unsigned char >::iterator it, std::vector< unsigned char >::iterator en)
 
void EncodeChunkLength (const int &start, const unsigned int &chunk_length)
 
void DecodeChunk (const int start, std::vector< unsigned char >::iterator it, std::vector< unsigned char >::iterator en)
 
unsigned int DecodeChunkLength (const int &start)
 

Private Attributes

int image_capacity
 

Additional Inherited Members

- Protected Member Functions inherited from Steganography
std::vector< unsigned char > ReadPayload (const boost::filesystem::path &payload_path)
 
void WritePayload (const boost::filesystem::path &payload_path, const std::vector< unsigned char > &payload)
 
template<class T >
void SetBit (T *target, const int &bit, const int &value)
 
template<class T >
int GetBit (const T &target, const int &bit)
 
- Protected Attributes inherited from Steganography
boost::filesystem::path image_path
 
cv::Mat image
 

Constructor & Destructor Documentation

◆ LeastSignificantBit()

LeastSignificantBit::LeastSignificantBit ( const boost::filesystem::path &  image_path)
inline

Default constructor for LeastSignificantBit class overrides the default constructor for the Steganography class.

Parameters
image_pathThe path to the input carrier image.

Member Function Documentation

◆ Decode()

void LeastSignificantBit::Decode ( )
virtual

Decode the payload from the steganographic image by reading from one or more least significant bits.

Implements Steganography.

◆ DecodeChunk()

void LeastSignificantBit::DecodeChunk ( const int  start,
std::vector< unsigned char >::iterator  it,
std::vector< unsigned char >::iterator  en 
)
private

Attempt to decode a chunk of information from the steganographic image.

Parameters
startThe bit index to start decoding at.
itAn iterator to a start position in the payload_bytes vector.
enAn iterator to an end position in the payload_bytes vector.
Exceptions
DecodeExceptionThrown when decoding fails.

◆ DecodeChunkLength()

unsigned int LeastSignificantBit::DecodeChunkLength ( const int &  start)
private

Attempt to decode the 32bit integer stating the length of the following chunk.

Parameters
startThe bit index to start decoding at.
Returns
The length of the following chunk.
Exceptions
DecodeExceptionThrown when decoding fails.

◆ Encode()

void LeastSignificantBit::Encode ( const boost::filesystem::path &  payload_path)
virtual

Encode the payload file into the carrier image by embedding into one or more least significant bits.

Parameters
payload_pathPath to the file we are encoding.
Exceptions
EncodeExceptionThrown when encoding fails.

Implements Steganography.

◆ EncodeChunk()

void LeastSignificantBit::EncodeChunk ( const int &  start,
std::vector< unsigned char >::iterator  it,
std::vector< unsigned char >::iterator  en 
)
private

Encode a chunk of information into the carrier image.

Before encoding a chunk of information you "should" first encode its length using the EncodeChunkLength function.

Parameters
startThe bit index to start encoding at.
itThe position in the chunk of information to start encoding.
enThe position in the chunk of information to stop encoding.

◆ EncodeChunkLength()

void LeastSignificantBit::EncodeChunkLength ( const int &  start,
const unsigned int &  chunk_length 
)
private

Encode a 32bit integer stating the length of the following chunk into the carrier image.

Parameters
startThe bit index to start encoding at.
chunk_lengthThe length of the next chunk in bytes.

Member Data Documentation

◆ image_capacity

LeastSignificantBit::image_capacity
private

The total capacity of the carrier image in bits.


The documentation for this class was generated from the following files: