1 #ifndef _LIBKVIRIJNDAEL_H_
2 #define _LIBKVIRIJNDAEL_H_
31 #ifdef COMPILE_CRYPT_SUPPORT
41 virtual ~KviRijndaelEngine();
50 Rijndael * m_pEncryptCipher;
51 Rijndael * m_pDecryptCipher;
52 OperationalMode m_bEncryptMode;
53 OperationalMode m_bDecryptMode;
56 virtual bool init(
const char * encKey,
int encKeyLen,
const char * decKey,
int decKeyLen);
61 virtual bool binaryToAscii(
const char *,
int,
KviCString &) {
return false; };
62 virtual bool asciiToBinary(
const char *,
int *,
char **) {
return false; };
63 virtual int getKeyLen() {
return 32; };
64 virtual Rijndael::KeyLength getKeyLenId() {
return Rijndael::Key32Bytes; };
66 void setLastErrorFromRijndaelErrorCode(
int errCode);
69 class KviRijndaelHexEngine :
public KviRijndaelEngine
73 KviRijndaelHexEngine() : KviRijndaelEngine(){};
74 virtual ~KviRijndaelHexEngine(){};
77 virtual bool binaryToAscii(
const char * inBuffer,
int len,
KviCString & outBuffer);
78 virtual bool asciiToBinary(
const char * inBuffer,
int * len,
char ** outBuffer);
81 class KviRijndael128HexEngine :
public KviRijndaelHexEngine
85 KviRijndael128HexEngine() : KviRijndaelHexEngine(){};
86 virtual ~KviRijndael128HexEngine(){};
89 virtual int getKenLen() {
return 16; };
90 virtual Rijndael::KeyLength getKeyLenId() {
return Rijndael::Key16Bytes; };
93 class KviRijndael192HexEngine :
public KviRijndaelHexEngine
97 KviRijndael192HexEngine() : KviRijndaelHexEngine(){};
98 virtual ~KviRijndael192HexEngine(){};
101 virtual int getKenLen() {
return 24; };
102 virtual Rijndael::KeyLength getKeyLenId() {
return Rijndael::Key24Bytes; };
105 class KviRijndael256HexEngine :
public KviRijndaelHexEngine
109 KviRijndael256HexEngine() : KviRijndaelHexEngine(){};
110 virtual ~KviRijndael256HexEngine(){};
113 virtual int getKenLen() {
return 32; };
116 class KviRijndaelBase64Engine :
public KviRijndaelEngine
120 KviRijndaelBase64Engine() : KviRijndaelEngine(){};
121 virtual ~KviRijndaelBase64Engine(){};
124 virtual bool binaryToAscii(
const char * inBuffer,
int len,
KviCString & outBuffer);
125 virtual bool asciiToBinary(
const char * inBuffer,
int * len,
char ** outBuffer);
128 class KviRijndael128Base64Engine :
public KviRijndaelBase64Engine
132 KviRijndael128Base64Engine() : KviRijndaelBase64Engine(){};
133 virtual ~KviRijndael128Base64Engine(){};
136 virtual int getKenLen() {
return 16; };
137 virtual Rijndael::KeyLength getKeyLenId() {
return Rijndael::Key16Bytes; };
140 class KviRijndael192Base64Engine :
public KviRijndaelBase64Engine
144 KviRijndael192Base64Engine() : KviRijndaelBase64Engine(){};
145 virtual ~KviRijndael192Base64Engine(){};
148 virtual int getKenLen() {
return 24; };
149 virtual Rijndael::KeyLength getKeyLenId() {
return Rijndael::Key24Bytes; };
152 class KviRijndael256Base64Engine :
public KviRijndaelBase64Engine
156 KviRijndael256Base64Engine() : KviRijndaelBase64Engine(){};
157 virtual ~KviRijndael256Base64Engine(){};
160 virtual int getKenLen() {
return 32; };
164 #define MCPS2_STARTTAG "\xABm\xAB"
165 #define MCPS2_ENDTAG "\xBBm\xBB"
171 KviMircryptionEngine();
172 ~KviMircryptionEngine();
181 virtual bool isCryptographicEngine() {
return false; };
182 virtual bool init(
const char * encKey,
int encKeyLen,
const char * decKey,
int decKeyLen);
193 #endif // COMPILE_CRYPT_SUPPORT
195 #endif // _LIBKVIRIJNDAEL_H_
EncryptResult
Definition: KviCryptEngine.h:68
Definition: KviCString.h:105
DecryptResult
Definition: KviCryptEngine.h:75
Definition: KviCryptEngine.h:54
int init()
Definition: winamp.cpp:118
This file contains compile time settings.