crypto++

Error compiling in release mode but not in debug mode

倖福魔咒の 提交于 2020-01-06 16:08:30
问题 When I compile on VS 2008 in deubg mode everything works fine. When I compile the same thing in release mode not everything works. As far as I can tell the include directories are the same and there are no additional preprocessor symbols. Any help? 1>zlib.cpp 1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(419) : error C2664: 'CryptoPP::AllocatorWithCleanup::AllocatorWithCleanup(const CryptoPP::AllocatorWithCleanup &)' : cannot convert parameter 1 from 'CryptoPP:

How to use a custom key in Crypto++

被刻印的时光 ゝ 提交于 2020-01-06 12:41:09
问题 I have a question referring to the encryption code in this question: Crypto++ encrypt and decrypt in two different c++ programs If I want to use a custom key/iv, how can I do this? 回答1: If I want to use a custom key/iv, how can I do this? Just plug it into a cipher with a mode. There are plenty of modes to choose from, but you should use an authenticated encryption mode like EAX, CCM or GCM. See Category:Mode for discussion of the modes in Crypto++. The code below takes a password or secret,

How to use a custom key in Crypto++

瘦欲@ 提交于 2020-01-06 12:41:07
问题 I have a question referring to the encryption code in this question: Crypto++ encrypt and decrypt in two different c++ programs If I want to use a custom key/iv, how can I do this? 回答1: If I want to use a custom key/iv, how can I do this? Just plug it into a cipher with a mode. There are plenty of modes to choose from, but you should use an authenticated encryption mode like EAX, CCM or GCM. See Category:Mode for discussion of the modes in Crypto++. The code below takes a password or secret,

Cooperation between Eclipse and Crypto++

亡梦爱人 提交于 2020-01-06 05:40:29
问题 I am trying to use the Crypto++ Library for AES encryption/decryption. Installation went on well, and I created a Project in Eclipse. In the Project Explorer, under the "includes" category, I can see /usr/include/crypt.h , /usr/include/crypt++/aes.h and /usr/include/cryptpp/aes.h . When I type #include <aes.h> , Eclipse interprets it as an "Unresolved Inclusion". On the one hand, it seems normal because aes.h is not located directly in the /usr/include directory. On the other hand, on every

Crypto++ “Tee”-style filter

南笙酒味 提交于 2020-01-04 21:39:28
问题 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

How to load Base64 RSA keys in Crypto++

微笑、不失礼 提交于 2020-01-04 09:09:28
问题 I'm trying to write helper functions for a program I'm making and I need to return the keys as strings. Found a way to convert the RSA keys from PrivateKey/PublicKey to Base64 string. int main() { //Generate params AutoSeededRandomPool rng; InvertibleRSAFunction params; params.Initialize(rng, 4096); //Generate Keys RSA::PrivateKey privKey(params); RSA::PublicKey pubKey(params); //Encode keys to Base64 string encodedPriv, encodedPub; Base64Encoder privKeySink(new StringSink(encodedPriv));

Load RSA PKCS#1 private key from memory?

旧街凉风 提交于 2020-01-04 05:27:36
问题 I have to write a program to establish a secure communication with a USB device. I have to use the private key generated from it which is stored in PKCS#1 format. As I have used Crypto++ in order part of my program, I would like to utilize it for this purpose as well. However, I cannot find a way to import RSA private key from memory. It accepts private key in PKCS#8 format only. Could some pro show me a sample code on how to do it? Many thanks! 回答1: PKCS#1 format is ASN.1 encoded. For

Speed difference between AES/CBC encryption and decryption?

本秂侑毒 提交于 2020-01-01 05:48:08
问题 I am wondering, theoretically, how much slower would AES/CBC decryption be compared to AES/CBC encryption with the following conditions: Encryption key of 32 bytes (256 bits); A blocksize of 16 bytes (128 bits). The reason that I ask is that I want to know if the decryption speed of an implementation that I have is not abnormally slow. I have done some tests on random memory blocks of different sizes. The results are as follows: 64B: 64KB: 10MB – 520MB: All data was stored on the internal

First 16 bytes of AES-128 CFB-8 decryption are damaged

那年仲夏 提交于 2019-12-31 07:16:08
问题 I've been working on a project recently that should connect to a server with the help of a protocol. So far so good, but when I combed to decrypt the packages, I quickly noticed that something is not working properly. The first 16 bytes of all packets are decrypted incorrectly. I have tried it with different libraries but that does not work either. I work in the C++ language and have so far used Crypto++ and OpenSSL for decryption, without success. Under this Link you can find the protocol,

First 16 bytes of AES-128 CFB-8 decryption are damaged

亡梦爱人 提交于 2019-12-31 07:15:30
问题 I've been working on a project recently that should connect to a server with the help of a protocol. So far so good, but when I combed to decrypt the packages, I quickly noticed that something is not working properly. The first 16 bytes of all packets are decrypted incorrectly. I have tried it with different libraries but that does not work either. I work in the C++ language and have so far used Crypto++ and OpenSSL for decryption, without success. Under this Link you can find the protocol,