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 ;
76 static const Translation Translations[] ;
77} ;
78
79#endif // ndef SH_ENCMODE_H
Definition EncryptionMode.h:26
IRep
integer representation of encryption mode
Definition EncryptionMode.h:32
@ CFB
Definition EncryptionMode.h:36
@ OFB
Definition EncryptionMode.h:35
@ STREAM
Definition EncryptionMode.h:40
@ CBC
Definition EncryptionMode.h:34
@ NCFB
Definition EncryptionMode.h:38
@ CTR
Definition EncryptionMode.h:39
@ ECB
Definition EncryptionMode.h:33
@ NOFB
Definition EncryptionMode.h:37
void setValue(IRep irep)
Definition EncryptionMode.cc:39
EncryptionMode(void)
Definition EncryptionMode.cc:24
static const Translation Translations[]
Definition EncryptionMode.h:98
static bool isValidStringRep(std::string srep)
Definition EncryptionMode.cc:54
static bool isValidIntegerRep(unsigned int irep)
Definition EncryptionMode.cc:65
IRep Value
Definition EncryptionMode.h:70
struct EncryptionMode::struct_Translation Translation
static const unsigned int NumValues
Definition EncryptionMode.h:69
std::string getStringRep(void) const
Definition EncryptionMode.cc:44
bool operator==(const EncryptionMode &mode) const
Definition EncryptionMode.h:59
static std::string translate(IRep irep)
Definition EncryptionMode.cc:70
IRep getIntegerRep(void) const
Definition EncryptionMode.cc:49
static const unsigned int IRep_size
number of bits needed to code the mode
Definition EncryptionMode.h:29
Definition EncryptionMode.h:72
IRep irep
Definition EncryptionMode.h:73
char * srep
Definition EncryptionMode.h:74