crypto++

Invalid PKCS #7 block padding when using Crypto++

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 15:23:31
问题 We are using cryptopp library. We are using the below coding. Encryption is working file without any issue and we are able to get the cipher text. But getting an error while decrypting as "Block padding found". What could be the issue...? #include <iostream> #include <string> using namespace std; #include "cryptlib.h" #include "filters.h" #include "files.h" #include "modes.h" #include "hex.h" #include "aes.h" #include "osrng.h" using namespace CryptoPP; using CryptoPP::AutoSeededRandomPool;

Use of Pipelines to encrypt a file

大城市里の小女人 提交于 2019-12-11 13:17:55
问题 I have just startet working with crypto++ and i have a question about the piplenes and how to use them to encrypt a file. I want to use AES to encrypt a file. 1.)Would it be enough to just do: EAX<AES>::Encryption encryptor; encryptor.SetKeyWithIV(derived.data(), 16, ivb, ivb.size()); FileSource f("source", new AuthenticatedEncryptionFilter(encryptor,new FileSink("deststination"))); 2.) If i have a huge input file, will this approach automaticly encrypt the files in blocks? 3.) Would this

How can I run in Crypto++ library benchmarks test?

懵懂的女人 提交于 2019-12-11 12:01:07
问题 Can someone help me how can I run in Crypto++ benchmarks test? I have to make some tests. I found Crypto++ but I don't know how use benchmarks test in Crypto++. I also want to run them after installing the library. Thanks for help. 回答1: Can someone help me how can I run in Crypto++ benchmarks test? $ cd cryptopp-src $ make static cryptest.exe $ ./cryptest.exe b 3 2.76566 > benchmarks.html cryptest.exe takes three arguments: (1) b for benchmarks, (2) time for the length of each test, in

Crypto++ exception calling messageEnd

ぐ巨炮叔叔 提交于 2019-12-11 10:39:36
问题 I use following code to decrypt a file: FileSource fe(fileUrl.c_str(), false, new AuthenticatedDecryptionFilter(decryptor, new FileSink( std::string(fileUrl).c_str()), CryptoPP::AuthenticatedDecryptionFilter::THROW_EXCEPTION | CryptoPP::AuthenticatedDecryptionFilter::MAC_AT_END )); size_t BLOCK_SIZE = 16384; while (remaining && !fe.SourceExhausted()) { const unsigned int req = STDMIN(remaining, BLOCK_SIZE); fe.Pump(req); fe.Flush(false); remaining -= req; } fe.MessageEnd(); If i try to do

Cannot kill Qt thread with CryptoPP FileSink running in the thread run method

断了今生、忘了曾经 提交于 2019-12-11 10:09:39
问题 I have a UI app in C++ and QT5.4, Im using CryptoPP 5.6.2 to encrypt files. I ran into the following problem: When the Encrypt button is hit, a new thread is started based on this tutorial. // new thread CryptoWorkerThread = new QThread; this->worker = new CryptoWorker(fileName.c_str(), newFileName.c_str(), key, keyLength, iv); this->worker->moveToThread(CryptoWorkerThread); connect(worker, SIGNAL(error(QString)), this, SLOT(errorString(QString))); connect(CryptoWorkerThread, SIGNAL(started()

Unable to make on MingW due to unrecognized option

南笙酒味 提交于 2019-12-11 09:51:42
问题 I have no clue why it doesn't work.. Normally this is supposed to be the easy part, I'm trying to get this fucked up thing to work for days and it still doesn't do anything. Please Help me because I'm very close to throwing this computer through the window. > C:\...\Downloads\crypto50>mingw32-make -f > GNUmakefile process_begin: > CreateProcess(NULL, uname, ...) failed. process_begin: > CreateProcess(NULL, uname, ...) failed. process_begin: > CreateProcess(NULL, uname, ...) failed. g++ -g

Can't DER encode and BER decode RSA public key

偶尔善良 提交于 2019-12-11 09:33:30
问题 I have problems using Crypto++ to save a RSA public key (that I obtained loading a private key file in PKCS#8 format). When decoding the key, I always get a BERDecodeErr exception. Here is the code I am using: CryptoPP::RSASSA_PKCS1v15_SHA_Signer _signer; CryptoPP::RSASSA_PKCS1v15_SHA_Verifier _verifier; CryptoPP::ByteQueue bytes; //_signer.AccessPublicKey().Save(bytes); // seem to save private key instead _signer.AccessKey().DEREncodePublicKey(bytes); //_verifier.AccessKey().Load(bytes); //

QT console application with Crypto++ library

和自甴很熟 提交于 2019-12-11 08:47:05
问题 This is driving me nuts. Using crypto++ ver 5.6.2. Qt 5.2.1 on Mac OSX. All the projects are built inside QT Creator. Im not using make from the command line I build crypto++ by unpacking and building as follow: qmake -project Deleted the GNUmakefile Open in QT and modified the .pro file by adding macx { DEFINES += CRYPTOPP_DISABLE_ASM } The target is cryptopp: TARGET = cryptopp Set to release, ran qmake and did a rebuild all. The dylibs get generated: libcryptopp.1.0.0.dylib libcryptopp.1.0

How can I recover compressed y value from sender?

半城伤御伤魂 提交于 2019-12-11 07:19:34
问题 I am working on following scenario: Generate private and public key Generate compressed public key with: PublicKey.AccessGroupParameters().SetPointCompression(true) Sign some data and send to other end with compressed public key. [At other end] verify signature using public key For step 4, I need recover y value. Is there some API I can use among Crypto++? 回答1: For step 4, I need recover y value. Is there some API I can use among Crypto++? During verification, you will load the persisted or

Generating an ONVIF authentication digest using Crypto++?

末鹿安然 提交于 2019-12-11 05:47:46
问题 The ONVIF authentication spec section 6.1.1.3 has what looks like a straight forward description of how to generate a digest. However, when using Crypto++ for Base64 and SHA1 operations, I cannot generate the same hash as the specification. I must be doing something wrong but cannot see what. std::string nonce = "LKqI6G/AikKCQrN0zqZFlg=="; std::string dt = "2010-09-16T07:50:45Z"; std::string pwd = "userpassword"; { // result should be tuOSpGlFlIXsozq4HFNeeGeFLEI= // as per spec. This approach