E:\cryptopp>make -j4 'make' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
时间: 2024-06-02 18:06:52 浏览: 17
这是因为您在 Windows 操作系统上使用了 Linux 的 make 命令,而 Windows 并不支持该命令。如果您需要在 Windows 上编译程序,可以考虑使用类似 Visual Studio 的集成开发环境(IDE),或者使用类似 MinGW 的工具链。如果您想在 Linux 或 macOS 等 Unix-like 系统上编译程序,可以通过安装 make 和必要的依赖来解决该问题。
相关问题
cryptopp+des加密文件
你可以使用cryptopp库来进行DES加密文件。以下是一个简单的示例:
#include <fstream>
#include <cryptopp/des.h>
#include <cryptopp/modes.h>
using namespace CryptoPP;
int main()
{
// 加载明文文件
std::ifstream plaintextFile("plaintext.txt", std::ios::binary);
std::string plaintext((std::istreambuf_iterator<char>(plaintextFile)),
std::istreambuf_iterator<char>());
// 准备密钥和IV
byte key[DES::DEFAULT_KEYLENGTH] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};
byte iv[DES::BLOCKSIZE] = {0x8c, 0x9d, 0x95, 0x15, 0xb7, 0x96, 0xdc, 0x05};
// 加密
CBC_Mode<DES>::Encryption encryption(key, sizeof(key), iv);
std::string ciphertext;
StringSource(plaintext, true,
new StreamTransformationFilter(encryption,
new StringSink(ciphertext)
)
);
// 保存密文到文件
std::ofstream ciphertextFile("ciphertext.txt", std::ios::binary);
ciphertextFile << ciphertext;
return 0;
}
注意:在使用cryptopp库进行加密文件时,要确保使用适当的密钥和IV来加密和解密文件。另外,一旦加密文件,您将需要使用相同的密钥和IV来解密文件。
CryptoPP::StringSource(new_digest, true, new CryptoPP::Redirector(encoder_new));
这段代码使用 Crypto++ 库中的 StringSource 类将字符串 new_digest 传入编码器 encoder_new 中进行编码,并将编码结果存储到一个临时字符串中。第二个参数设置为 true 表示在 StringSource 对象生命周期结束时自动清空临时字符串。最后,通过 Redirector 类将编码结果重定向到 encoder_new 对象中,以便进行进一步处理或输出。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)