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