steghide  0.5.1
EmbData.h
Go to the documentation of this file.
1 /*
2  * steghide 0.5.1 - a steganography program
3  * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  */
20 
21 #ifndef SH_EMBDATA_H
22 #define SH_EMBDATA_H
23 
24 #include <string>
25 #include <vector>
26 
27 #include "common.h"
28 
29 #include "BitString.h"
30 #include "EncryptionAlgorithm.h"
31 #include "EncryptionMode.h"
32 
33 class EmbData {
34  public:
35  enum MODE { EMBED, EXTRACT } ;
37 
44  EmbData (MODE m, std::string pp, std::string fn = "") ;
45 
46  BitString getBitString (void) ;
47 
48  bool finished (void) ;
49 
53  unsigned long getNumBitsRequested (void) ;
54 
55  void addBits (BitString addbits) ;
56 
58  EncryptionAlgorithm getEncAlgo (void) const ;
59 
60  void setEncMode (EncryptionMode m) ;
61  EncryptionMode getEncMode (void) const ;
62 
63  void setCompression (int c) ;
64  int getCompression (void) const ;
65 
66  void setChecksum (bool c) ;
67  bool getChecksum (void) const ;
68 
73  bool checksumOK (void) const ;
74 
75  void setData (const std::vector<BYTE> data)
76  { Data = data ; } ;
77 
78  std::vector<BYTE> getData (void) const
79  { return Data ; } ;
80 
81  std::string getFileName (void) const
82  { return FileName ; } ;
83 
85  static const unsigned int MinStegoHeaderSize = 50 ;
86 
87  protected:
88  std::string stripDir (std::string s) ;
89 
90  private:
92  static const unsigned int NBitsNPlainBits = 32 ;
94  static const unsigned int NBitsNUncompressedBits = 32 ;
96  static const unsigned int NBitsCrc32 = 32 ;
98  static const unsigned short CodeVersion = 0 ;
100  static const UWORD32 Magic = 0x73688DUL ;
102  static const unsigned int NBitsMagic = 24 ;
103 
106 
107  unsigned long NPlainBits ;
108 
110  unsigned long NumBitsRequested ;
112  unsigned long NumBitsNeeded ;
113 
115 
116  std::string Passphrase ;
117 
119  unsigned short Version ;
120 
126  bool Checksum ;
128  unsigned long CRC32 ;
129  std::string FileName ;
131  std::vector<BYTE> Data ;
132 } ;
133 
134 #endif // ndef SH_EMBDATA_H
EmbData::EncMode
EncryptionMode EncMode
Definition: EmbData.h:122
EmbData::READ_ENCINFO
Definition: EmbData.h:36
EmbData::setCompression
void setCompression(int c)
Definition: EmbData.cc:290
EmbData::getEncAlgo
EncryptionAlgorithm getEncAlgo(void) const
Definition: EmbData.cc:275
EmbData::EncAlgo
EncryptionAlgorithm EncAlgo
Definition: EmbData.h:121
EmbData::setData
void setData(const std::vector< BYTE > data)
Definition: EmbData.h:75
EmbData::getCompression
int getCompression(void) const
Definition: EmbData.cc:295
EmbData::getBitString
BitString getBitString(void)
Definition: EmbData.cc:310
EmbData::setEncAlgo
void setEncAlgo(EncryptionAlgorithm a)
Definition: EmbData.cc:270
EmbData::Version
unsigned short Version
version read from input bitstring
Definition: EmbData.h:119
EmbData::Passphrase
std::string Passphrase
Definition: EmbData.h:116
EmbData::getFileName
std::string getFileName(void) const
Definition: EmbData.h:81
EmbData::addBits
void addBits(BitString addbits)
Definition: EmbData.cc:54
EmbData::READ_ENCRYPTED
Definition: EmbData.h:36
UWORD32
unsigned long UWORD32
Definition: common.h:45
EmbData::getChecksum
bool getChecksum(void) const
Definition: EmbData.cc:305
EmbData::NumBitsRequested
unsigned long NumBitsRequested
the number of bits that the caller must at least supply to addBits
Definition: EmbData.h:110
EmbData::FileName
std::string FileName
Definition: EmbData.h:129
EmbData::CodeVersion
static const unsigned short CodeVersion
version of this steghide embedding (stego compatibility of EmbData)
Definition: EmbData.h:98
EmbData::END
Definition: EmbData.h:36
EmbData::EMBED
Definition: EmbData.h:35
EmbData::Mode
MODE Mode
Definition: EmbData.h:104
EmbData::READ_NPLAINBITS
Definition: EmbData.h:36
EmbData::NBitsNUncompressedBits
static const unsigned int NBitsNUncompressedBits
number of bits used to code the number of uncompressed bits
Definition: EmbData.h:94
EmbData::CRC32
unsigned long CRC32
the checksum
Definition: EmbData.h:128
BitString.h
EmbData::stripDir
std::string stripDir(std::string s)
Definition: EmbData.cc:366
EmbData::NBitsMagic
static const unsigned int NBitsMagic
size (in bits of Magic)
Definition: EmbData.h:102
EmbData::finished
bool finished(void)
Definition: EmbData.cc:42
EmbData::READ_VERSION
Definition: EmbData.h:36
EmbData::Data
std::vector< BYTE > Data
contains the actual message to be embedded
Definition: EmbData.h:131
EmbData::getData
std::vector< BYTE > getData(void) const
Definition: EmbData.h:78
BitString
a string of bits
Definition: BitString.h:42
EmbData::getEncMode
EncryptionMode getEncMode(void) const
Definition: EmbData.cc:285
EncryptionMode.h
EmbData::checksumOK
bool checksumOK(void) const
Definition: EmbData.cc:248
EmbData::EXTRACT
Definition: EmbData.h:35
common.h
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::NBitsNPlainBits
static const unsigned int NBitsNPlainBits
number of bits used to code the number of plain bits
Definition: EmbData.h:92
EmbData::NBitsCrc32
static const unsigned int NBitsCrc32
size of a crc32 checksum in bits
Definition: EmbData.h:96
EmbData::State
STATE State
Definition: EmbData.h:105
EmbData::Compression
int Compression
compression level: 0(none),1(best speed),...,9(best compression)
Definition: EmbData.h:124
EmbData
Definition: EmbData.h:33
EmbData::Reservoir
BitString Reservoir
Definition: EmbData.h:114
EmbData::READ_MAGIC
Definition: EmbData.h:36
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
EncryptionAlgorithm.h
EmbData::getNumBitsRequested
unsigned long getNumBitsRequested(void)
Definition: EmbData.cc:48
EmbData::STATE
STATE
Definition: EmbData.h:36
EmbData::setEncMode
void setEncMode(EncryptionMode m)
Definition: EmbData.cc:280
EmbData::NPlainBits
unsigned long NPlainBits
Definition: EmbData.h:107
EmbData::setChecksum
void setChecksum(bool c)
Definition: EmbData.cc:300
EmbData::Magic
static const UWORD32 Magic
steghide magic to recognize embedded data (the string "shm")
Definition: EmbData.h:100
EmbData::MODE
MODE
Definition: EmbData.h:35
EmbData::Checksum
bool Checksum
will a checksum be embedded ?
Definition: EmbData.h:126
EncryptionMode
Definition: EncryptionMode.h:26
EncryptionAlgorithm
Definition: EncryptionAlgorithm.h:26
EmbData::EmbData
EmbData(MODE m, std::string pp, std::string fn="")
Definition: EmbData.cc:31