1 Star 0 Fork 28

范书/文件软硬件加解密平台

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TDEA.h 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
qingfengfumeng 提交于 2024-11-05 21:45 +08:00 . add TDEA.h
#ifndef TDEA_H
#define TDEA_H
/**************************************************
* project name: 3DES
* author: wang binbin
* completion time: 2024.4.16
*************************************************/
#pragma once
#include "DES.h"
#include <iostream>
using namespace std;
#define SECRET_KEY_PATH "key.txt"
#define ENCRYPTED_FILE "encrypted_file.txt"
#define DECRYPTED_FILE "decrypted_file.txt"
class TDEA
{
public:
TDEA();
// Generate random key
void genKey(std::string outputname);
// Get the key from the file
void getKey(std::string filename);
// Encrypt file
bool encrypt_file(const string filename, const string outname);
// Decrypt file
bool decrypt_file(const string filename, const string outname);
private:
std::string Key;
std::string key1, key2, key3;
// Converts the character to the corresponding two-digit hexadecimal number
std::string charToHex(unsigned char ch);
// Converts two hexadecimal digits to the corresponding integer
int hexToInt(string hex_str);
};
#endif // TDEA_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/model-book/cryptography_file_protection.git
git@gitee.com:model-book/cryptography_file_protection.git
model-book
cryptography_file_protection
文件软硬件加解密平台
master

搜索帮助