-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Debug 1.0.
- Loading branch information
Showing
35 changed files
with
9,457 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.