steghide  0.5.1
CvrStgFile.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_CVRSTGFILE_H
22 #define SH_CVRSTGFILE_H
23 
24 #include <list>
25 #include <string>
26 #include <map>
27 
28 #include "BinaryIO.h"
29 #include "CvrStgObject.h"
30 class Graph ;
31 class Matching ;
32 class MatchingAlgorithm ;
33 class SampleValue ;
35 
46 class CvrStgFile : public CvrStgObject {
47  public:
52  static CvrStgFile *readFile (const std::string& fn) ;
53 
54  class Property : private std::pair<std::string,std::string> {
55  public:
56  Property (std::string key, std::string value)
57  : std::pair<std::string,std::string> (key, value) {} ;
58 
59  std::string getKey (void) const
60  { return first ; } ;
61 
62  std::string getValue (void) const
63  { return second ; } ;
64  } ;
65 
66  CvrStgFile (void) ;
67  virtual ~CvrStgFile (void) ;
68 
69  virtual void read (BinaryIO *io) ;
70  virtual void write (void) ;
71  void transform (const std::string& fn) ;
72 
73  virtual std::list<Property> getProperties (void) const = 0 ;
74 
86  virtual std::vector<SampleValueAdjacencyList*> calcSVAdjacencyLists (const std::vector<SampleValue*>& svs) const ;
87 
95  virtual std::vector<MatchingAlgorithm*> getMatchingAlgorithms (Graph* g, Matching* m) const ;
96 
100  const std::string& getName (void) const
101  { return getBinIO()->getName() ; } ;
102 
103  bool is_std (void) const
104  { return getBinIO()->is_std() ; } ;
105 
110  unsigned long getCapacity (void) const ;
111 
115  std::string getHRCapacity (void) const ;
116 
120  unsigned short getSamplesPerVertex (void) const
121  { return SamplesPerVertex ; } ;
125  UWORD32 getRadius (void) const
126  { return Radius ; } ;
131  { return EmbValueModulus ; } ;
132 
142  virtual EmbValue getEmbeddedValue (const SamplePos pos) const ;
143 
144 #ifdef DEBUG
145 
148  virtual std::map<SampleKey,unsigned long>* getFrequencies (void) ;
155  virtual void printFrequencies (const std::map<SampleKey,unsigned long>& freqs) ;
156 #endif
157 
158  protected:
159  void setSamplesPerVertex (unsigned short spv)
160  { SamplesPerVertex = spv ; } ;
164  void setRadius (UWORD32 r) ;
166  { EmbValueModulus = m ; } ;
167 
168  void setBinIO (BinaryIO* io)
169  { BinIO = io ; } ;
170 
171  BinaryIO* getBinIO (void) const
172  { return BinIO ; } ;
173 
174  private:
175  enum FILEFORMAT { UNKNOWN, BMP, WAV, AU, JPEG } ;
176 
180  static FILEFORMAT guessff (BinaryIO *io) ;
181 
183 
184  unsigned short SamplesPerVertex ;
187 } ;
188 
189 #endif /* ndef SH_CVRSTGFILE_H */
EmbValue EmbValueModulus
Definition: CvrStgFile.h:186
virtual EmbValue getEmbeddedValue(const SamplePos pos) const
Definition: CvrStgFile.cc:111
unsigned short getSamplesPerVertex(void) const
Definition: CvrStgFile.h:120
const std::string & getName(void) const
Definition: CvrStgFile.h:100
virtual std::vector< SampleValueAdjacencyList * > calcSVAdjacencyLists(const std::vector< SampleValue *> &svs) const
Definition: CvrStgFile.cc:79
virtual std::vector< MatchingAlgorithm * > getMatchingAlgorithms(Graph *g, Matching *m) const
Definition: CvrStgFile.cc:103
virtual ~CvrStgFile(void)
Definition: CvrStgFile.cc:46
unsigned short SamplesPerVertex
Definition: CvrStgFile.h:184
a graph constructed from a cover file and a message to be embedded
Definition: Graph.h:51
void setRadius(UWORD32 r)
Definition: CvrStgFile.cc:53
a cover-/stego-file
Definition: CvrStgFile.h:46
unsigned long getCapacity(void) const
Definition: CvrStgFile.cc:119
EmbValue getEmbValueModulus(void) const
Definition: CvrStgFile.h:130
Definition: CvrStgFile.h:175
an object that can hold embedded data
Definition: CvrStgObject.h:40
Definition: CvrStgFile.h:175
UWORD32 SamplePos
Definition: common.h:67
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
void setEmbValueModulus(EmbValue m)
Definition: CvrStgFile.h:165
FILEFORMAT
Definition: CvrStgFile.h:175
std::string getKey(void) const
Definition: CvrStgFile.h:59
static CvrStgFile * readFile(const std::string &fn)
Definition: CvrStgFile.cc:186
std::string getHRCapacity(void) const
Definition: CvrStgFile.cc:126
an adjacency list-like data structur for sample values
Definition: SampleValueAdjacencyList.h:33
UWORD32 Radius
Definition: CvrStgFile.h:185
unsigned long UWORD32
Definition: common.h:45
represent a matching on a graph
Definition: Matching.h:41
Definition: CvrStgFile.h:175
provides methods for file i/o as needed by the rest of steghide
Definition: BinaryIO.h:33
void setSamplesPerVertex(unsigned short spv)
Definition: CvrStgFile.h:159
void transform(const std::string &fn)
Definition: CvrStgFile.cc:72
const std::string & getName(void) const
Definition: BinaryIO.h:53
Definition: CvrStgFile.h:54
BinaryIO * BinIO
Definition: CvrStgFile.h:182
BinaryIO * getBinIO(void) const
Definition: CvrStgFile.h:171
UWORD32 getRadius(void) const
Definition: CvrStgFile.h:125
static FILEFORMAT guessff(BinaryIO *io)
Definition: CvrStgFile.cc:155
BYTE EmbValue
Definition: common.h:66
std::string getValue(void) const
Definition: CvrStgFile.h:62
Definition: CvrStgFile.h:175
Definition: MatchingAlgorithm.h:27
Definition: CvrStgFile.h:175
virtual void write(void)
Definition: CvrStgFile.cc:68
bool is_std(void) const
Definition: CvrStgFile.h:103
CvrStgFile(void)
Definition: CvrStgFile.cc:40
Property(std::string key, std::string value)
Definition: CvrStgFile.h:56
virtual std::list< Property > getProperties(void) const =0
bool is_std(void) const
Definition: BinaryIO.h:65
virtual void read(BinaryIO *io)
Definition: CvrStgFile.cc:63
void setBinIO(BinaryIO *io)
Definition: CvrStgFile.h:168