krcrypto.h
来自「windowxp 下各种系统提供的加密方法:rsa,des,sha,md5」· C头文件 代码 · 共 23 行
H
23 行
#pragma once
#include <string>
class CKrCrypto
{
public:
CKrCrypto(void);
~CKrCrypto(void);
static bool Base64Encode(std::string& strTxt);
static bool Base64Decode(std::string& strTxt);
static bool GenRsaKeyPair(std::string& strPub, std::string& strPrv, const int& nKeySize = 1024);
static bool RandomEnCrypt(std::string& strText, const std::string& strPubKey, std::string& strRandKey);
static bool RandomDeCrypt(std::string& strText, const std::string& strPrvKey, const std::string& strRandKey);
static bool Md5Hash(const std::string& strText, std::string& strMd5);
static bool Sha1Hash(const std::string& strText, std::string& strSha1);
static void Hex16Encode(std::string& strText);
static bool Hex16Decode(std::string& strText);
static bool SimpleEnCrypt(std::string& strText, const std::string& strKey);
static bool RsaEnCrypt(std::string& strText, const std::string& strKey);
static bool RsaDecrypt(std::string& strText, const std::string& strKey);
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?