Steganography
A C++ Steganography tool which leverages the LSB and DCT embedding techniques
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Steganography Class Referenceabstract

#include <steganography.hpp>

Inheritance diagram for Steganography:
Inheritance graph
Collaboration diagram for Steganography:
Collaboration graph

Public Member Functions

 Steganography (const boost::filesystem::path &image_path)
 
virtual void Encode (const boost::filesystem::path &payload_path)=0
 
virtual void Decode ()=0
 

Protected Member Functions

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

boost::filesystem::path image_path
 
cv::Mat image
 

Detailed Description

Abstract base class which each steganography technique will extend.

Constructor & Destructor Documentation

◆ Steganography()

Steganography::Steganography ( const boost::filesystem::path &  image_path)
inlineexplicit

Default constructor for Steganography class, will be overridden for different steganography techniques.

Parameters
image_pathThe path to the input carrier image.

Member Function Documentation

◆ Decode()

virtual void Steganography::Decode ( )
pure virtual

Decode Function that must be overridden by the subclass which decodes a payload from the carrier image using the steganographic technique defined in the subclass.

Implemented in DiscreteCosineTransform, and LeastSignificantBit.

◆ Encode()

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

Encode Function that must be overridden by the subclass which encodes a payload into the carrier image using the steganographic technique defined in the subclass.

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

Implemented in DiscreteCosineTransform, and LeastSignificantBit.

◆ GetBit()

template<class T >
int Steganography::GetBit ( const T &  target,
const int &  bit 
)
inlineprotected

Get the n'th significant bit of a generic type.

This function is designed to get the n'th significant bit of integer/char types. It assumes that it is being used correctly; there is no incorrect input detection.

Template Parameters
target"Any" type which works with bytewise operators, the target to set the but of.
Parameters
bitWhich bit to get in the target.
Returns
The n'th significant bit.

◆ ReadPayload()

std::vector< unsigned char > Steganography::ReadPayload ( const boost::filesystem::path &  payload_path)
protected

Read all the bytes from a payload file into a vector.

Parameters
payload_pathThe path to the file to read as the payload.
Returns
A vector containing all the bytes from the payload file.

◆ SetBit()

template<class T >
void Steganography::SetBit ( T *  target,
const int &  bit,
const int &  value 
)
inlineprotected

Set the n'th significant bit of a generic type.

This function is designed to set the n'th significant bit of integer/char types. It assumes that it is being used correctly; there is no incorrect input detection.

Template Parameters
target"Any" type which works with bytewise operators, the target to set the bit of.
Parameters
bitWhich bit to set in the target.
valueThe value the target bit will be set too.

◆ WritePayload()

void Steganography::WritePayload ( const boost::filesystem::path &  payload_path,
const std::vector< unsigned char > &  payload 
)
protected

Write all the bytes decoded from the carrier image to a file.

Parameters
payload_pathThe path to the file that will be created.
payloadThe payload decoded from the carrier image.

Member Data Documentation

◆ image

Steganography::image
protected

An in memory copy of the input image in which we will embed the data.

◆ image_path

Steganography::image_path
protected

The path to the carrier image stored on disk. This image will not be modified.


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