mfcdes加密解密.docVIP

  • 16
  • 0
  • 约1.71万字
  • 约 12页
  • 2017-11-10 发布于江苏
  • 举报
mfcdes加密解密

//DES.h #pragma once class DES { public: //类构造函数 DES(); //类析构函数 ~DES(); //功能:产生16个28位的key //参数:源8位的字符串(key),存放key的序号0-1 //结果:函数将调用private CreateSubKey将结果存于char SubKeys[keyN][16][48] void InitializeKey(char* srcBytes,unsigned int keyN); //功能:加密8位字符串 //参数:8位字符串,使用Key的序号0-1 //结果:函数将加密后结果存放于private szCiphertext[16] // 用户通过属性Ciphertext得到 void EncryptData(char* _srcBytes,unsigned int keyN); //功能:解密16位十六进制字符串 //参数:16位十六进制字符串,使用Key的序号0-1 //结果:函数将解密候结果存放于private szPlaintext[8] // 用户通过属性Plaintext得到 void DecryptData(char* _srcBytes,unsigned int keyN); //功能:加密任意长度字符串 //参数:任意长度字符串,长度,使用Key的序号0-1 //结果:函数将加密后结果存放于private szFCiphertextAnyLength[8192] // 用户通过属性CiphertextAnyLength得到 void EncryptAnyLength(char* _srcBytes,unsigned int _bytesLength,unsigned int keyN); //功能:解密任意长度十六进制字符串 //参数:任意长度字符串,长度,使用Key的序号0-1 //结果:函数将加密后结果存放于private szFPlaintextAnyLength[8192] // 用户通过属性PlaintextAnyLength得到 void DecryptAnyLength(char* _srcBytes,unsigned int _bytesLength, unsigned int keyN); //功能:Bytes到Bits的转换, //参数:待变换字符串,处理后结果存放缓冲区指针,Bits缓冲区大小 void Bytes2Bits(char *srcBytes, char* dstBits, unsigned int sizeBits); //功能:Bits到Bytes的转换, //参数:待变换字符串,处理后结果存放缓冲区指针,Bits缓冲区大小 void Bits2Bytes(char *dstBytes, char* srcBits, unsigned int sizeBits); //功能:Int到Bits的转换, //参数:待变换字符串,处理后结果存放缓冲区指针 void Int2Bits(unsigned int srcByte, char* dstBits); //功能:Bits到Hex的转换 //参数:待变换字符串,处理后结果存放缓冲区指针,Bits缓冲区大小 void Bits2Hex(char *dstHex, char* srcBits, unsigned int sizeBits); //功能:Bits到Hex的转换 //参数:待变换字符串,处理后结果存放缓冲区指针,Bits缓冲区大小 void Hex2Bits(char *srcHex, char* dstBits, unsigned int sizeBits); //szCiphertextInBinary的get函数 char* GetCiphertextInBinary(); //szCiphertextInHex的get函数 char* GetCiphertextInHex(); //Ciphertext的get函数 char* GetCiphertextInBytes(); //Plaintext的get函数 char* GetPlaintext(); //CiphertextAnyLength的get函数 char* GetCiphertextAnyLength(); //PlaintextAnyLength的get函数 char* GetPlaintextAnyLength(); CString EncryptCString(CString str); CStrin

文档评论(0)

1亿VIP精品文档

相关文档