steghide  0.5.1
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
EmbData Class Reference

#include <EmbData.h>

Public Types

enum  MODE { EMBED, EXTRACT }
 
enum  STATE {
  READ_MAGIC, READ_VERSION, READ_ENCINFO, READ_NPLAINBITS,
  READ_ENCRYPTED, END
}
 

Public Member Functions

 EmbData (MODE m, std::string pp, std::string fn="")
 
BitString getBitString (void)
 
bool finished (void)
 
unsigned long getNumBitsRequested (void)
 
void addBits (BitString addbits)
 
void setEncAlgo (EncryptionAlgorithm a)
 
EncryptionAlgorithm getEncAlgo (void) const
 
void setEncMode (EncryptionMode m)
 
EncryptionMode getEncMode (void) const
 
void setCompression (int c)
 
int getCompression (void) const
 
void setChecksum (bool c)
 
bool getChecksum (void) const
 
bool checksumOK (void) const
 
void setData (const std::vector< BYTE > data)
 
std::vector< BYTEgetData (void) const
 
std::string getFileName (void) const
 

Static Public Attributes

static const unsigned int MinStegoHeaderSize = 50
 the minimum size of the part of the generatred BitString that is not the data More...
 

Protected Member Functions

std::string stripDir (std::string s)
 

Private Attributes

MODE Mode
 
STATE State
 
unsigned long NPlainBits
 
unsigned long NumBitsRequested
 the number of bits that the caller must at least supply to addBits More...
 
unsigned long NumBitsNeeded
 exactly the number of bits that the next step will consume from Reservoir and addBits together More...
 
BitString Reservoir
 
std::string Passphrase
 
unsigned short Version
 version read from input bitstring More...
 
EncryptionAlgorithm EncAlgo
 
EncryptionMode EncMode
 
int Compression
 compression level: 0(none),1(best speed),...,9(best compression) More...
 
bool Checksum
 will a checksum be embedded ? More...
 
unsigned long CRC32
 the checksum More...
 
std::string FileName
 
std::vector< BYTEData
 contains the actual message to be embedded More...
 

Static Private Attributes

static const unsigned int NBitsNPlainBits = 32
 number of bits used to code the number of plain bits More...
 
static const unsigned int NBitsNUncompressedBits = 32
 number of bits used to code the number of uncompressed bits More...
 
static const unsigned int NBitsCrc32 = 32
 size of a crc32 checksum in bits More...
 
static const unsigned short CodeVersion = 0
 version of this steghide embedding (stego compatibility of EmbData) More...
 
static const UWORD32 Magic = 0x73688DUL
 steghide magic to recognize embedded data (the string "shm") More...
 
static const unsigned int NBitsMagic = 24
 size (in bits of Magic) More...
 

Member Enumeration Documentation

Enumerator
EMBED 
EXTRACT 
Enumerator
READ_MAGIC 
READ_VERSION 
READ_ENCINFO 
READ_NPLAINBITS 
READ_ENCRYPTED 
END 

Constructor & Destructor Documentation

EmbData::EmbData ( MODE  m,
std::string  pp,
std::string  fn = "" 
)

construct a new EmbData object

Parameters
mthe mode (EMBED or EXTRACT)
ppthe passphrase
fnthe filename (only need for mode EMBED)

Member Function Documentation

void EmbData::addBits ( BitString  addbits)
bool EmbData::checksumOK ( void  ) const

check if crc32 checksum is ok (needs filled Data and CRC32 fields)

Returns
true iff checksum is ok
bool EmbData::finished ( void  )
BitString EmbData::getBitString ( void  )
bool EmbData::getChecksum ( void  ) const
int EmbData::getCompression ( void  ) const
std::vector<BYTE> EmbData::getData ( void  ) const
inline
EncryptionAlgorithm EmbData::getEncAlgo ( void  ) const
EncryptionMode EmbData::getEncMode ( void  ) const
std::string EmbData::getFileName ( void  ) const
inline
unsigned long EmbData::getNumBitsRequested ( void  )

get the minimum length of the BitString that is to be passed to addBits

void EmbData::setChecksum ( bool  c)
void EmbData::setCompression ( int  c)
void EmbData::setData ( const std::vector< BYTE data)
inline
void EmbData::setEncAlgo ( EncryptionAlgorithm  a)
void EmbData::setEncMode ( EncryptionMode  m)
std::string EmbData::stripDir ( std::string  s)
protected

Member Data Documentation

bool EmbData::Checksum
private
const unsigned short EmbData::CodeVersion = 0
staticprivate
int EmbData::Compression
private
unsigned long EmbData::CRC32
private
std::vector<BYTE> EmbData::Data
private
EncryptionAlgorithm EmbData::EncAlgo
private
EncryptionMode EmbData::EncMode
private
std::string EmbData::FileName
private
const UWORD32 EmbData::Magic = 0x73688DUL
staticprivate
const unsigned int EmbData::MinStegoHeaderSize = 50
static
MODE EmbData::Mode
private
const unsigned int EmbData::NBitsCrc32 = 32
staticprivate
const unsigned int EmbData::NBitsMagic = 24
staticprivate
const unsigned int EmbData::NBitsNPlainBits = 32
staticprivate
const unsigned int EmbData::NBitsNUncompressedBits = 32
staticprivate
unsigned long EmbData::NPlainBits
private
unsigned long EmbData::NumBitsNeeded
private
unsigned long EmbData::NumBitsRequested
private
std::string EmbData::Passphrase
private
BitString EmbData::Reservoir
private
STATE EmbData::State
private
unsigned short EmbData::Version
private

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