00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef SH_ENCALGO_H
00022
#define SH_ENCALGO_H
00023
00024
#include <string>
00025
00026 class EncryptionAlgorithm {
00027
public:
00029 static const unsigned int IRep_size = 5 ;
00030
00032 enum IRep {
00033
NONE = 0,
00034
TWOFISH = 1,
00035
RIJNDAEL128 = 2,
00036
RIJNDAEL192 = 3,
00037
RIJNDAEL256 = 4,
00038
SAFERPLUS = 5,
00039
RC2 = 6,
00040
XTEA = 7,
00041
SERPENT = 8,
00042
SAFERSK64 = 9,
00043
SAFERSK128 = 10,
00044
CAST256 = 11,
00045
LOKI97 = 12,
00046
GOST = 13,
00047
THREEWAY = 14,
00048
CAST128 = 15,
00049
BLOWFISH = 16,
00050
DES = 17,
00051
TRIPLEDES = 18,
00052
ENIGMA = 19,
00053
ARCFOUR = 20,
00054
PANAMA = 21,
00055
WAKE = 22
00056 } ;
00057
00058
EncryptionAlgorithm (
void) ;
00059
EncryptionAlgorithm (IRep irep) ;
00064
EncryptionAlgorithm (std::string srep) ;
00065
00066
void setValue (IRep irep) ;
00067
00068 std::string
getStringRep (
void) const ;
00069 IRep getIntegerRep (
void) const ;
00070
00071 bool operator== (const
EncryptionAlgorithm& algo)
const
00072
{
return (
Value == algo.Value) ; } ;
00073
00079
static bool isValidStringRep (std::string srep) ;
00080
00081
static bool isValidIntegerRep (
unsigned int irep) ;
00082
00086
static std::string translate (IRep irep) ;
00087
00091
static IRep translate (std::string srep) ;
00092
00093
private:
00094 static const unsigned int NumValues = 23 ;
00095 IRep Value ;
00096
00097 typedef struct struct_Translation {
00098 IRep
irep ;
00099 char*
srep ;
00100 }
Translation ;
00101
static const Translation Translations[] ;
00102 } ;
00103
00104
#endif // ndef SH_ENCALGO_H