Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Update Debug 1.0.
  • Loading branch information
ProYRB authored Apr 10, 2021
1 parent 45a8f4c commit e2199df
Show file tree
Hide file tree
Showing 35 changed files with 9,457 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cencrypt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/******************************
* Author : YangRongBao
* Date : 2021.4
******************************/

#include "cencrypt.h"

CEncrypt::CEncrypt()
{
;
}

CEncrypt::~CEncrypt()
{
;
}

QByteArray CEncrypt::XOR(QByteArray byteArray, CEncryptModel encryptMode)
{
switch (encryptMode) {
case Model_XOR:
{
QByteArray KEY = "8A3500F5BBD2A41";
int keyIndex;
for(int index = 0; index < byteArray.size(); ++index)
{
keyIndex = index % KEY.size();
byteArray[index] = byteArray[index] ^ KEY[keyIndex];
}
break;
}
}
return byteArray;
}
36 changes: 36 additions & 0 deletions cencrypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/******************************
* Author : YangRongBao
* Date : 2021.4
******************************/

#ifndef CENCRYPT_H
#define CENCRYPT_H

#include <QChar>
#include <QString>
#include <QByteArray>

class CEncrypt
{
public:
enum CEncryptError
{
Error_None, //无错误
};
enum CEncryptModel
{
Model_XOR, //异或加密解密
};

CEncrypt();
~CEncrypt();

QByteArray XOR(QByteArray, CEncryptModel);

protected:

private:

};

#endif // CENCRYPT_H
Loading

0 comments on commit e2199df

Please sign in to comment.