EmbData.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_EMBDATA_H
#define SH_EMBDATA_H
#include <string>
#include <vector>
#include "common.h"
#include "BitString.h"
#include "EncryptionAlgorithm.h"
#include "EncryptionMode.h"
class EmbData {
public:
enum MODE { EMBED, EXTRACT } ;
enum STATE { READ_MAGIC, READ_VERSION, READ_ENCINFO, READ_NPLAINBITS, READ_ENCRYPTED, END } ;
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)
{ Data = data ; } ;
std::vector<BYTE> getData (void) const
{ return Data ; } ;
std::string getFileName (void) const
{ return FileName ; } ;
static const unsigned int MinStegoHeaderSize = 50 ;
protected:
std::string stripDir (std::string s) ;
private:
static const unsigned int NBitsNPlainBits = 32 ;
static const unsigned int NBitsNUncompressedBits = 32 ;
static const unsigned int NBitsCrc32 = 32 ;
static const unsigned short CodeVersion = 0 ;
static const UWORD32 Magic = 0x73688DUL ;
static const unsigned int NBitsMagic = 24 ;
MODE Mode ;
STATE State ;
unsigned long NPlainBits ;
unsigned long NumBitsRequested ;
unsigned long NumBitsNeeded ;
BitString Reservoir ;
std::string Passphrase ;
unsigned short Version ;
EncryptionAlgorithm EncAlgo ;
EncryptionMode EncMode ;
int Compression ;
bool Checksum ;
unsigned long CRC32 ;
std::string FileName ;
std::vector<BYTE> Data ;
} ;
#endif // ndef SH_EMBDATA_H
BitString.h
EncryptionAlgorithm.h
EncryptionMode.h
BitString
a string of bits
Definition BitString.h:42
EmbData::MODE
MODE
Definition EmbData.h:35
EmbData::EXTRACT
@ EXTRACT
Definition EmbData.h:35
EmbData::EMBED
@ EMBED
Definition EmbData.h:35
EmbData::checksumOK
bool checksumOK(void) const
Definition EmbData.cc:248
EmbData::NumBitsRequested
unsigned long NumBitsRequested
the number of bits that the caller must at least supply to addBits
Definition EmbData.h:110
EmbData::Reservoir
BitString Reservoir
Definition EmbData.h:114
EmbData::Compression
int Compression
compression level: 0(none),1(best speed),...,9(best compression)
Definition EmbData.h:124
EmbData::EmbData
EmbData(MODE m, std::string pp, std::string fn="")
Definition EmbData.cc:31
EmbData::Checksum
bool Checksum
will a checksum be embedded ?
Definition EmbData.h:126
EmbData::NPlainBits
unsigned long NPlainBits
Definition EmbData.h:107
EmbData::Passphrase
std::string Passphrase
Definition EmbData.h:116
EmbData::Magic
static const UWORD32 Magic
steghide magic to recognize embedded data (the string "shm")
Definition EmbData.h:100
EmbData::NBitsCrc32
static const unsigned int NBitsCrc32
size of a crc32 checksum in bits
Definition EmbData.h:96
EmbData::getChecksum
bool getChecksum(void) const
Definition EmbData.cc:305
EmbData::MinStegoHeaderSize
static const unsigned int MinStegoHeaderSize
the minimum size of the part of the generatred BitString that is not the data
Definition EmbData.h:85
EmbData::setData
void setData(const std::vector< BYTE > data)
Definition EmbData.h:75
EmbData::getData
std::vector< BYTE > getData(void) const
Definition EmbData.h:78
EmbData::EncAlgo
EncryptionAlgorithm EncAlgo
Definition EmbData.h:121
EmbData::getBitString
BitString getBitString(void)
Definition EmbData.cc:310
EmbData::finished
bool finished(void)
Definition EmbData.cc:42
EmbData::setEncMode
void setEncMode(EncryptionMode m)
Definition EmbData.cc:280
EmbData::setChecksum
void setChecksum(bool c)
Definition EmbData.cc:300
EmbData::Data
std::vector< BYTE > Data
contains the actual message to be embedded
Definition EmbData.h:131
EmbData::NumBitsNeeded
unsigned long NumBitsNeeded
exactly the number of bits that the next step will consume from Reservoir and addBits together
Definition EmbData.h:112
EmbData::CodeVersion
static const unsigned short CodeVersion
version of this steghide embedding (stego compatibility of EmbData)
Definition EmbData.h:98
EmbData::CRC32
unsigned long CRC32
the checksum
Definition EmbData.h:128
EmbData::EncMode
EncryptionMode EncMode
Definition EmbData.h:122
EmbData::getEncMode
EncryptionMode getEncMode(void) const
Definition EmbData.cc:285
EmbData::NBitsNUncompressedBits
static const unsigned int NBitsNUncompressedBits
number of bits used to code the number of uncompressed bits
Definition EmbData.h:94
EmbData::addBits
void addBits(BitString addbits)
Definition EmbData.cc:54
EmbData::STATE
STATE
Definition EmbData.h:36
EmbData::READ_NPLAINBITS
@ READ_NPLAINBITS
Definition EmbData.h:36
EmbData::READ_ENCINFO
@ READ_ENCINFO
Definition EmbData.h:36
EmbData::READ_VERSION
@ READ_VERSION
Definition EmbData.h:36
EmbData::READ_MAGIC
@ READ_MAGIC
Definition EmbData.h:36
EmbData::READ_ENCRYPTED
@ READ_ENCRYPTED
Definition EmbData.h:36
EmbData::END
@ END
Definition EmbData.h:36
EmbData::NBitsNPlainBits
static const unsigned int NBitsNPlainBits
number of bits used to code the number of plain bits
Definition EmbData.h:92
EmbData::Version
unsigned short Version
version read from input bitstring
Definition EmbData.h:119
EmbData::getEncAlgo
EncryptionAlgorithm getEncAlgo(void) const
Definition EmbData.cc:275
EmbData::getNumBitsRequested
unsigned long getNumBitsRequested(void)
Definition EmbData.cc:48
EmbData::setCompression
void setCompression(int c)
Definition EmbData.cc:290
EmbData::State
STATE State
Definition EmbData.h:105
EmbData::NBitsMagic
static const unsigned int NBitsMagic
size (in bits of Magic)
Definition EmbData.h:102
EmbData::stripDir
std::string stripDir(std::string s)
Definition EmbData.cc:366
EmbData::getFileName
std::string getFileName(void) const
Definition EmbData.h:81
EmbData::getCompression
int getCompression(void) const
Definition EmbData.cc:295
EmbData::Mode
MODE Mode
Definition EmbData.h:104
EmbData::FileName
std::string FileName
Definition EmbData.h:129
EmbData::setEncAlgo
void setEncAlgo(EncryptionAlgorithm a)
Definition EmbData.cc:270
EncryptionAlgorithm
Definition EncryptionAlgorithm.h:26
EncryptionMode
Definition EncryptionMode.h:26
common.h
UWORD32
unsigned long UWORD32
Definition common.h:45