steghide  0.5.1
EncryptionMode.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_ENCMODE_H
22 #define SH_ENCMODE_H
23 
24 #include <string>
25 
27  public:
29  static const unsigned int IRep_size = 3 ;
30 
32  enum IRep {
33  ECB = 0,
34  CBC = 1,
35  OFB = 2,
36  CFB = 3,
37  NOFB = 4,
38  NCFB = 5,
39  CTR = 6,
40  STREAM = 7
41  } ;
42 
46  EncryptionMode (void) ;
47  EncryptionMode (IRep irep) ;
52  EncryptionMode (std::string srep) ;
53 
54  void setValue (IRep irep) ;
55 
56  std::string getStringRep (void) const ;
57  IRep getIntegerRep (void) const ;
58 
59  bool operator== (const EncryptionMode& mode) const
60  { return (Value == mode.Value) ; } ;
61 
62  static bool isValidStringRep (std::string srep) ;
63  static bool isValidIntegerRep (unsigned int irep) ;
64 
65  static std::string translate (IRep irep) ;
66  static IRep translate (std::string srep) ;
67 
68  private:
69  static const unsigned int NumValues = 8 ;
71 
72  typedef struct struct_Translation {
74  char* srep ;
75  } Translation ;
76  static const Translation Translations[] ;
77 } ;
78 
79 #endif // ndef SH_ENCMODE_H
EncryptionMode::setValue
void setValue(IRep irep)
Definition: EncryptionMode.cc:39
EncryptionMode::isValidStringRep
static bool isValidStringRep(std::string srep)
Definition: EncryptionMode.cc:54
EncryptionMode::CTR
@ CTR
Definition: EncryptionMode.h:39
EncryptionMode::IRep_size
static const unsigned int IRep_size
number of bits needed to code the mode
Definition: EncryptionMode.h:29
EncryptionMode::struct_Translation::irep
IRep irep
Definition: EncryptionMode.h:73
EncryptionMode::ECB
@ ECB
Definition: EncryptionMode.h:33
EncryptionMode::translate
static std::string translate(IRep irep)
Definition: EncryptionMode.cc:70
EncryptionMode::STREAM
@ STREAM
Definition: EncryptionMode.h:40
EncryptionMode::Translation
struct EncryptionMode::struct_Translation Translation
EncryptionMode::CFB
@ CFB
Definition: EncryptionMode.h:36
EncryptionMode::operator==
bool operator==(const EncryptionMode &mode) const
Definition: EncryptionMode.h:59
EncryptionMode::IRep
IRep
integer representation of encryption mode
Definition: EncryptionMode.h:32
EncryptionMode::getStringRep
std::string getStringRep(void) const
Definition: EncryptionMode.cc:44
EncryptionMode::NOFB
@ NOFB
Definition: EncryptionMode.h:37
EncryptionMode::struct_Translation
Definition: EncryptionMode.h:72
EncryptionMode::NumValues
static const unsigned int NumValues
Definition: EncryptionMode.h:69
EncryptionMode::Translations
static const Translation Translations[]
Definition: EncryptionMode.h:76
EncryptionMode::OFB
@ OFB
Definition: EncryptionMode.h:35
EncryptionMode::struct_Translation::srep
char * srep
Definition: EncryptionMode.h:74
EncryptionMode::CBC
@ CBC
Definition: EncryptionMode.h:34
EncryptionMode::getIntegerRep
IRep getIntegerRep(void) const
Definition: EncryptionMode.cc:49
EncryptionMode::Value
IRep Value
Definition: EncryptionMode.h:70
EncryptionMode::EncryptionMode
EncryptionMode(void)
Definition: EncryptionMode.cc:24
EncryptionMode::isValidIntegerRep
static bool isValidIntegerRep(unsigned int irep)
Definition: EncryptionMode.cc:65
EncryptionMode
Definition: EncryptionMode.h:26
EncryptionMode::NCFB
@ NCFB
Definition: EncryptionMode.h:38