一:加密&解密
#include "openssl/aes.h"
#include "openssl/pem.h"
#include "openssl/err.h"
#include "openssl/rsa.h"
#include "openssl/md5.h"
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
AES编码
1:生成random aes密码A
2:使用公钥对A加密生成B
3:对B进行base64编码生成C
4:C作为enclose字段,存入参数map D
5:使用密码A对数据进行加密
RSA编码
1:使用公钥对数据进行加密
requesturl&&sign
1:由参数map D生成strQuery(需要urlencode)
2: 由参数map D和发送数据的md5生成strMatrix
3: 由strMatrix和服务端数据签名私钥生成strMatrix2
4:对strMatrix2生成md5,作为签名
二:压缩&解压
#include "zlib.h"
#include "unzip.h"
gz/ugz
数据发送前gz
收到响应后ugz
参考资料:
urlencode的标准实现
https://blog.youkuaiyun.com/gemo/article/details/8468311
使用openssl库实现RSA、AES数据加密
https://www.cnblogs.com/cswuyg/p/3187462.html