34 Star 68 Fork 28

qingfengfumeng/文件软硬件加解密平台

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hardDESwidget.h 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
ainwpu 提交于 2025-03-31 19:13 +08:00 . 增加硬件DES前端设计
#ifndef HARDDESWIDGET_H
#define HARDDESWIDGET_H
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <random>
#include <ctime>
#include <QWidget>
#include <QDebug>
//#include <chrono>
//#include <thread>
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort/QSerialPort>
using namespace std;
namespace Ui { class hardDESwidget; }
class hardDESwidget : public QWidget
{
Q_OBJECT
public:
explicit hardDESwidget(QWidget *parent = 0);
~hardDESwidget();
private slots:
void genpushButton_click();
void filepushButton_click();
void keypushButton_click();
void encryptpushButton_click();
void decryptpushButton_click();
void backpushButton_click();
signals:
void sendsignal();
private:
Ui::hardDESwidget *ui;
void serial_inf();
void chartostring(unsigned char s);
std::string charToHex(unsigned char ch);
QByteArray stringtoarray(string s);
unsigned char stringtochar(string s);
std::string intToHex(int value);
int hexToInt(std::string hexStr);
void genKey(std::string outputname);
void getKey(std::string filename);
void encrypt(std::string in_hex_str);
void decrypt(std::string in_hex_str);
bool encrypt_file(const string filename);
bool decrypt_file(const string filename);
void dataRead();
string dataProcess();
QByteArray des_cmd;
QByteArray encrypt_signal; // 加密信号
QByteArray decrypt_signal; // 解密信号
QByteArray recvd;
QByteArray set_key; // 设置密钥信号
QByteArray send_key; // 发送密钥信号
QByteArray set_pt; // 设置明文信号
QByteArray send_pt; // 发送明文信号
QSerialPort *serial_port;
QString port_name;
string infile_path;
string key_path;
string key_str;
QByteArray readdata;
};
#endif // HARDDESWIDGET_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qingfengfumeng/cryptography_file_protection.git
git@gitee.com:qingfengfumeng/cryptography_file_protection.git
qingfengfumeng
cryptography_file_protection
文件软硬件加解密平台
master

搜索帮助