crypto++

StreamTransformationFilter: invalid PKCS #7 block padding found in AES decryption

风流意气都作罢 提交于 2019-12-04 05:07:36
问题 I want to use AES-256 encryption/decryption in my C++ code to do that I use cryptoPP library, I have implement encryption and decryption. but I get Error : StreamTransformationFilter: invalid PKCS #7 block padding found Error. The senario which I test is : First I encrypt myplaintext then decrypt it --> there is no error here. Second I decrypt the cipher created above --> here I got the error. I know that there are same question here but I couldn't solve my problem :( Here I set iv: byte iv

CLion and Crypto++ library

天大地大妈咪最大 提交于 2019-12-04 04:24:33
问题 Some time ago I started coding my application in Visual Studio 2015, had no issues setting all of the library dependencies. Now, I decided to move to CLion. However my application has a dependency of cryptopp library, which I need to link in my CLion project. Currently, I'm facing tons of undefined reference errors undefined reference to `CryptoPP::Integer::Integer(char const*)' undefined reference to `CryptoPP::Integer::Integer(char const*)' undefined reference to `CryptoPP::Integer::Integer

Speed difference between AES/CBC encryption and decryption?

拟墨画扇 提交于 2019-12-03 16:31:32
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 memory of my system. The application generates the data to encrypt by itself. Virtual memory is disabled

Get ECDSA signature with Crypto++

限于喜欢 提交于 2019-12-02 18:18:53
问题 I have to get ECDSA signature in variable using Crypto++. I tried to get it after launching SignMessage but signature is empty. How could i get it? 回答1: Have you had a look at the Crypto++ wiki? There's a lot of stuff on Elliptic Curve Digital Signature Algorithm. Its not really clear what you are doing or where things went wrong, so here's a copy and paste from the wiki: Signing: ECDSA<ECP, SHA1>::PrivateKey privateKey; privateKey.Load(...); AutoSeededRandomPool prng; string message = "Yoda

How to loop over Blowfish Crypto++

丶灬走出姿态 提交于 2019-12-02 14:06:47
问题 I am running Crypto++ doing speed tests on encryption algorithms. I am trying to time how long it takes to encrypt, then decrypt the data(eventually with more file sizes and different algorithms). I am running into a problem where I cannot loop over the code. In the following code, I am using Blowfish, but when I get to the encryption part, it gives me the error: HashVerificationFilter: message hash or MAC not valid What can I do to fix this? Do I need to put it in a function? If so, how

Get ECDSA signature with Crypto++

守給你的承諾、 提交于 2019-12-02 10:19:18
I have to get ECDSA signature in variable using Crypto++. I tried to get it after launching SignMessage but signature is empty. How could i get it? Have you had a look at the Crypto++ wiki? There's a lot of stuff on Elliptic Curve Digital Signature Algorithm . Its not really clear what you are doing or where things went wrong, so here's a copy and paste from the wiki: Signing: ECDSA<ECP, SHA1>::PrivateKey privateKey; privateKey.Load(...); AutoSeededRandomPool prng; string message = "Yoda said, Do or do not. There is no try."; string signature; StringSource ss1( message, true /*pump all*/, new

AES/CFB encryption with Crypto++ not working

有些话、适合烂在心里 提交于 2019-12-02 09:32:57
I have a simple console program that should encrypt files with AES CFB algorithm from Crypto++ library. For some reason it is not working. Encoding part: byte data[16] = { 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44 }; byte result[16] = { 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44 }; //Sample key byte key[16] = { 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44, 0x88, 0x44 }; //Generate random Initialization Vector byte iv[16]; CryptoPP::AutoSeededRandomPool

Scalar multiplication on secp521r1 using Crypto++

给你一囗甜甜゛ 提交于 2019-12-02 09:03:09
问题 I am writing the following code for scalar multiplication in elliptic curve in c++. The code runs when i don't initialize the value of the point. But when i do, it gives me the nullptr error. I have tried the below code: ECP r1; ECPPoint basepoint = ECPPoint(2,3); ECPPoint point; ECPPoint s1= ecp.ScalarMultiply(basepoint, x1); Error: CryptoPP::ECP::GetField(...) returned nullptr. 回答1: ERROR: CryptoPP::ECP::GetField(...) returned nullptr. For Crypto++ you need to load a curve. Based on the

Installing Crypto++ 5.6.2 on Mac OS X

十年热恋 提交于 2019-12-02 08:22:02
I'm trying to installing Crypto++ 5.6.2 on my Mac. When I run make -j4 libcryptopp.a" I get the following error: libtool: unrecognized option `-static' libtool: Try `libtool --help' for more information. make: *** [libcryptopp.a] Error 1 Can someone please help me with this? Can someone please help me with this? There's a couple of things you can do to make this easier. First, open GNUmake and add fPIC on line 1: CXXFLAGS = -DNDEBUG -g -O2 -fPIC Second, open GNUmake and drop "version" from the Clang detection logic on line 18: CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c

Scalar multiplication on secp521r1 using Crypto++

自古美人都是妖i 提交于 2019-12-02 07:28:20
I am writing the following code for scalar multiplication in elliptic curve in c++. The code runs when i don't initialize the value of the point. But when i do, it gives me the nullptr error. I have tried the below code: ECP r1; ECPPoint basepoint = ECPPoint(2,3); ECPPoint point; ECPPoint s1= ecp.ScalarMultiply(basepoint, x1); Error: CryptoPP::ECP::GetField(...) returned nullptr. ERROR: CryptoPP::ECP::GetField(...) returned nullptr. For Crypto++ you need to load a curve. Based on the code you posted it does not look like that has been done. Loading the curve loads the domain parameters for the