问题标签 [crypto++]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
188 浏览

c++ - Crypto++ "Tee"-style filter

I'm working on processing a data-stream based on some conditions.

Data is read from an input pipe, processed, and pushed down a Crypto++ CBC_Mode<AES> filter ending in a FileSink.

Now, I'd like to "snoop" on the data flowing between the encryption and file-store, calculating a checksum. For performance reasons, I want to do this while streaming, re-opening the output file and calculating a hash-sum after is not reasonable for my need.

From what I can see, what's missing for this to work, is some form of "tee" filter. Something splitting the data chain into two new chains, one for storing to file, and one chain for the hash-calculation.

Are there such functionality in Crypto++? Can I implement such filter myself, and if so, are there some guidelines or examples on what's needed for a custom Crypto++ filter? Are there some other way to calculate checksum on the fly?

0 投票
4 回答
3601 浏览

macos - 将 Crypto++ 与 clang 一起使用

我正在尝试使用 clang++ 在 iMac 上获取以下 Crypto++(密码方案的 C++ 类库)示例。

例子

构建命令

链接器输出

我正在使用 Crypto++ 5.6.2 的最新开发版本,因为以前的版本 5.6.1 无法使用 clang++ 构建。但是我遇到了构建问题,指出我缺少 x86_64 架构的符号。

任何提示将不胜感激。

0 投票
1 回答
2072 浏览

c++ - 使用 AES 和 Crypto++ 加密-解密单个块

我需要加密单个 AES 块。我不能使用任何模式,如 CBC 和其他。我看到的每个示例都使用流模式。

编辑:好的,我用下一种方式做了,但我真的不喜欢这个尝试。

0 投票
1 回答
5043 浏览

c++ - 使用 crypto++ 库的 RAW RSA 签名验证

如何使用 crypto++ 库验证数字签名?

输入数据为:

  • public_key BASE64 编码的十六进制字符串。
  • 来自公钥的公共指数。
  • 签名为十六进制字符串。

我不知道私钥部分。我已经编写了这个测试函数,但它总是以“VerifierFilter:数字签名无效”错误结束。

这里的密钥是从有效的密钥对导出的!

我错过了什么?

我将非常感谢任何帮助!提前致谢!

0 投票
4 回答
8955 浏览

c++ - 使用 AES / Crypto++ 解密

我试图弄清楚如何使用 AES 解密一个密文块。我正在使用 crypto++ 库 - 或者至少尝试使用该库。但我绝对无处可去。我假设运行这个解密算法只需要几行代码,但我想不通。这就是我写的。现在开始大笑:

谁能给我一个简短的教程,告诉我如何“简单地”解密一个 16 字节的密文块,给定一个使用 crypto++ 的解密密钥?他们的文档比您在上面看到的密文(至少对我而言)更神秘,而且我通过搜索几乎找不到帮助。非常感谢。

0 投票
1 回答
402 浏览

c++ - Encrypt QDataStream with AES

im writing a Qt application on linux (Qt 4.8.1) which writes data byte by byte to a QDataStream object. The data stream goes into a file. Now i need to encrypt this data with AES-256. I choose crypto++ lib for this purpose but im struggling with the implementation.

Does anybody know if it is possible at all to encrypt a QDataStream with the given filter classes of crypto++ lib?

greetz maggie

0 投票
1 回答
4185 浏览

c++ - 开始使用 AES 进行 crypto++ 解密

我正在尝试学习一些有关密码学的知识,并尝试将 AES 解密与 c++ 中的 crypto++ 库一起使用。我有一个密文字符串和一个密钥字符串。使用这两个,我想解密这个密文。这是我的代码:

我收到此代码的许多错误。最直接的是这个:

“解密”不是“CryptoPP::CBC_Mode”的成员

任何人都可以用这段代码理顺我。我一直在阅读 crypto++ 文档,但我看不出我做错了什么。

谢谢!

0 投票
1 回答
1566 浏览

dev-c++ - 无法在 Devc 上为 SHA-256 哈希编译加密

错误

编译器:默认编译器正在执行 g++.exe... g++.exe "C:\Users\Pr\Desktop\Work\encrypt\sha256\sampeSHA256.cpp" -o "C:\Users\Pr\Desktop\Work\encrypt\ sha256\sampeSHA256.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I "C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L "C:\Dev-Cpp\lib" 在来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/seckey.h:8 的文件中,来自 C:/Dev-Cpp/ include/c++/3.4.2/backward/..\cryptopp/rijndael.h:7,来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/aes.h:4,来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp\dll.h:11,来自 C:\Users\Pr\Desktop\Work\encrypt\sha256\sampeSHA256.cpp:1: C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/cryptlib.h:277: 错误:函数std::string CryptoPP::NameValuePairs::GetValueNames() const' definition is marked dllimport. C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp\/cryptlib.h:283: error: functionbool CryptoPP::NameValuePairs::GetIntValue(const char*, int&) const' 定义标记为 dllimport。C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/cryptlib.h:287: 错误:函数int CryptoPP::NameValuePairs::GetIntValueWithDefault(const char*, int) const' definition is marked dllimport. C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp\/cryptlib.h:291: error: function静态无效 CryptoPP::NameValuePairs::ThrowIfTypeMismatch(const char*, const std::type_info& , const std::type_info&)' 定义被标记为 dllimport。C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/cryptlib.h:301: 错误: 函数`void CryptoPP::NameValuePairs::GetRequiredIntParameter(const char*, const char*, int& ) const' 定义被标记为 dllimport。

在来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/aes.h:4 的文件中,来自 C:/Dev-Cpp/include/c++/3.4.2/backward/ ..\cryptopp\dll.h:11,来自 C:\Users\Pr\Desktop\Work\encrypt\sha256\sampeSHA256.cpp:1: C:/Dev-Cpp/include/c++/3.4.2/backward/ ..\cryptopp/rijndael.h:15:错误:函数 `static const char* CryptoPP::Rijndael_Info::StaticAlgorithmName()' 定义标记为 dllimport。

在来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp\dll.h:16 的文件中,来自 C:\Users\Pr\Desktop\Work\encrypt\sha256\sampeSHA256。 cpp:1: C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/des.h:58: 错误:函数`static const char* CryptoPP::DES_EDE2_Info::StaticAlgorithmName()'定义标记为 dllimport。

C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/des.h:82: error: function `static const char* CryptoPP::DES_EDE3_Info::StaticAlgorithmName()' 定义标记为 dllimport .

在来自 C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp\dll.h:37 的文件中,来自 C:\Users\Pr\Desktop\Work\encrypt\sha256\sampeSHA256。 cpp:1: C:/Dev-Cpp/include/c++/3.4.2/backward/..\cryptopp/skipjack.h:15: 错误:函数`static const char* CryptoPP::SKIPJACK_Info::StaticAlgorithmName()'定义标记为 dllimport。

执行终止

0 投票
2 回答
801 浏览

c++ - 如何在不读/写密钥文件的情况下使用 crypto++?

我正在使用 Crypto++ RSA api 加密和解密某些东西,RSAES_OAEP_SHA_Encryptor 和 RSAES_OAEP_SHA_Decryptor 都需要一个存储 pub/pri 密钥的文件。</p>

:( ,但我需要将密钥存储在我的 C++ 代码变量中,有什么方法可以避免访问文件吗?

还是有比 Crypto++ 更好的库?

0 投票
3 回答
9038 浏览

c++ - 对 CryptoPP::AlignedAllocate(unsigned int) 的未定义引用

我在 c++ linux 中使用 crypto++。这是我的简单代码:

当我运行它时,发生了一些错误:

然后,我使用命令

但是这个错误仍然存​​在:

我该如何解决这个错误?我的代码有问题吗?

我正在为这个包使用突触包管理器安装crypto++:

libcrypto++.a 和 libcrypto++.so 可以在 /usr/lib/ 中找到

提前致谢。