You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iAlg/iAlgEnc/zxEncryptAES.h

33 lines
916 B
C++

#pragma once
#include "zxAes.h"
// AES算法外调函数类
class I_ALGENC_EXPORT zxEncryptAES
{
public:
zxEncryptAES();
~zxEncryptAES();
/// @brief 加密解密部分
bool encryptFile(QString sFileSrc, QString sFileDest);
bool encryptFile(QString sFileSrc, QByteArray& ba);
bool decryptFile(QString sFileSrc, QString sFileDest);
bool decryptFile(QString sFileSrc, QByteArray& ba);
private:
// 内部实现函数
void InitPrivateKey(DWORD nKeySize, UCHAR *pKeyBytes); //AES 密钥初始化
DWORD OnAesEncrypt(LPVOID bufferIns,DWORD nLen, LPVOID bufferOuts); //AES 加密数据
DWORD OnAesUncrypt(LPVOID bufferIns,DWORD nLen, LPVOID bufferOuts); //AES 解密数据
bool encDecBa(QByteArray& baInput, QByteArray& baOutput, bool bEncMode);
bool saveBa2File(QByteArray& ba, QString sFileDest);
private:
zxAes* m_pAes;
};