30 lines
743 B
C++
30 lines
743 B
C++
/*
|
|
* 说明: 数据加密算法类(测绘模型数据加密要用到)
|
|
*
|
|
* 作者: 杨海洋
|
|
* 日期: 2023-10-30
|
|
*/
|
|
|
|
#ifndef CRYPTOALGORITHM_H
|
|
#define CRYPTOALGORITHM_H
|
|
|
|
#include "HDefine.h"
|
|
|
|
class JUDGE_API CryptoAlgorithm
|
|
{
|
|
public:
|
|
//注意:加密秘钥绝对不能变,加密和解密数据秘钥必须要配套!!! 2023-10-30 杨海洋
|
|
CryptoAlgorithm(const char* const key = "duolun-secret-key-603528-ABCDEFG");
|
|
virtual ~CryptoAlgorithm();
|
|
|
|
std::string encrypt(const std::string& data);
|
|
std::string decrypt(const std::string& data);
|
|
std::string encrypt(const char* data, int size);
|
|
std::string decrypt(const char* data, int size);
|
|
|
|
private:
|
|
std::string m_key;
|
|
};
|
|
|
|
#endif // CRYPTOALGORITHM_H
|