EncryptionMode.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_ENCMODE_H
#define SH_ENCMODE_H
#include <string>
class EncryptionMode {
public:
static const unsigned int IRep_size = 3 ;
enum IRep {
ECB = 0,
CBC = 1,
OFB = 2,
CFB = 3,
NOFB = 4,
NCFB = 5,
CTR = 6,
STREAM = 7
} ;
EncryptionMode (void) ;
EncryptionMode (IRep irep) ;
EncryptionMode (std::string srep) ;
void setValue (IRep irep) ;
std::string getStringRep (void) const ;
IRep getIntegerRep (void) const ;
bool operator== (const EncryptionMode& mode) const
{ return (Value == mode.Value) ; } ;
static bool isValidStringRep (std::string srep) ;
static bool isValidIntegerRep (unsigned int irep) ;
static std::string translate (IRep irep) ;
static IRep translate (std::string srep) ;
private:
static const unsigned int NumValues = 8 ;
IRep Value ;
typedef struct struct_Translation {
IRep irep ;
char* srep ;
} Translation ;
static const Translation Translations[] ;
} ;
#endif // ndef SH_ENCMODE_H
EncryptionMode::NumValues
static const unsigned int NumValues
Definition: EncryptionMode.h:69
EncryptionMode::STREAM
Definition: EncryptionMode.h:40
EncryptionMode::Translations
static const Translation Translations[]
Definition: EncryptionMode.h:76
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::CFB
Definition: EncryptionMode.h:36
EncryptionMode::struct_Translation::srep
char * srep
Definition: EncryptionMode.h:74
EncryptionMode::translate
static std::string translate(IRep irep)
Definition: EncryptionMode.cc:70
EncryptionMode::getStringRep
std::string getStringRep(void) const
Definition: EncryptionMode.cc:44
EncryptionMode::EncryptionMode
EncryptionMode(void)
Definition: EncryptionMode.cc:24
EncryptionMode::struct_Translation::irep
IRep irep
Definition: EncryptionMode.h:73
EncryptionMode::getIntegerRep
IRep getIntegerRep(void) const
Definition: EncryptionMode.cc:49
EncryptionMode::isValidIntegerRep
static bool isValidIntegerRep(unsigned int irep)
Definition: EncryptionMode.cc:65
EncryptionMode::Translation
struct EncryptionMode::struct_Translation Translation
EncryptionMode::OFB
Definition: EncryptionMode.h:35
EncryptionMode
Definition: EncryptionMode.h:26
EncryptionMode::struct_Translation
Definition: EncryptionMode.h:72
EncryptionMode::setValue
void setValue(IRep irep)
Definition: EncryptionMode.cc:39
EncryptionMode::Value
IRep Value
Definition: EncryptionMode.h:70
EncryptionMode::isValidStringRep
static bool isValidStringRep(std::string srep)
Definition: EncryptionMode.cc:54
EncryptionMode::NOFB
Definition: EncryptionMode.h:37
EncryptionMode::NCFB
Definition: EncryptionMode.h:38
EncryptionMode::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::CBC
Definition: EncryptionMode.h:34
EncryptionMode::ECB
Definition: EncryptionMode.h:33