crypto++

How to add Crypto++ library to Qt project

大兔子大兔子 提交于 2019-12-19 08:28:11
问题 I downloaded the Crypto++ source and compiled the cryptlib project in Visual Studio 2013, and then I added the generated .lib file to my Qt project, which made my .pro file look like this: QT += core gui QT += sql greaterThan(QT_MAJOR_VERSION, 4):QT += widgets TARGET = untitled TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h \ databasecontrol.h \ test.h FORMS += mainwindow.ui win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ -lcryptlib else:win32:CONFIG(debug,

no archive symbol table (run ranlib) while building libcryptopp.a through ndk-build

眉间皱痕 提交于 2019-12-18 09:07:46
问题 Here i am trying to build libcryptopp.a through ndk-build but i getting error as shown below. Android.mk Application.mk setenv-android.sh its while creating libcryptopp.a and .so by using cryptopp 5.6.3 Error produced in terminal as below $ /Users/kasbahapple/Documents/AndroidDocs/AndroidADT/adt-bundle-mac-x86_64-20140702/sdk/ndk-bundle/ndk-build [armeabi] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver [armeabi] Gdbsetup : libs/armeabi/gdb.setup [armeabi-v7a] Gdbserver : [arm

Using Crypto++ to generate random hashes with SHA1

蹲街弑〆低调 提交于 2019-12-18 04:21:58
问题 I need to generate a random hash using Crypto++, using SHA1. At the moment I have: #include <cryptopp/sha.h> #include <cryptopp/filters.h> #include <cryptopp/hex.h> ... CryptoPP::SHA1 sha1; string source = "Hello"; //This will be randomly generated somehow string hash = ""; StringSource(source, true, new HashFilter(sha1, new HexEncoder(new StringSink(hash)))); When I come to compile, I get the following error reported: error: expected type-specifier before 'HashFilter' error: expected ')'

How do I install Crypto++ in Visual Studio 2010?

混江龙づ霸主 提交于 2019-12-18 03:37:11
问题 I downloaded http://www.cryptopp.com/#download 5.6.1 and have no clue that to do at this point. I am a total noob and need good instructions. thanks. 回答1: Directly from the readme (Which can be found here Crypto++ Svn Trunk): * MSVC-Specific Information * On Windows, Crypto++ can be compiled into 3 forms: a static library including all algorithms, a DLL with only FIPS Approved algorithms, and a static library with only algorithms not in the DLL. (FIPS Approved means Approved according to the

Crypto++ giving a compiler error in algparam.h

孤者浪人 提交于 2019-12-14 04:17:22
问题 I have the following lines in a rather large file: #include <sha.h> #include <hex.h> Which, when compiled, throws this compiler error: 1>d:\work\app\tools\cryptopp\algparam.h(322): error C2061: syntax error : identifier 'buffer' 1> d:\work\app\tools\cryptopp\algparam.h(321) : while compiling class template member function 'void CryptoPP::AlgorithmParametersTemplate<T>::MoveInto(void *) const' 1> with 1> [ 1> T=bool 1> ] 1> d:\work\app\tools\cryptopp\algparam.h(329) : see reference to class

Truncated output from CFB mode when calling from C#

孤街醉人 提交于 2019-12-14 03:59:58
问题 I have pretty annoying issue which I'm unable to solve for 2 days. I have an encrypt() method which makes use of Crypto++ library written in C++. The method is implemented as follows: string CRijndaelHelper::Encrypt(string text) { CFB_Mode< AES >::Encryption e; e.SetKeyWithIV(_key, sizeof(_key), _iv); string cipher, encoded; // CFB mode must not use padding. Specifying // a scheme will result in an exception StringSource ss(text, true, new StreamTransformationFilter(e, new StringSink(cipher)

Encrypt and Decrypt a message using raw RSA algorithm in Crypto++?

好久不见. 提交于 2019-12-13 15:59:24
问题 I am using Crypto++ library for cryptography related works. And sub-part of task is to encrypt and decrypt a text. The message can be up to 256 character long containing alphanumeric number spaces dot and special characters. This piece of code is working for text length is less than or equal to 8. But after that it fails to decrypt the encrypted text. // g++ -std=c++1y crypto.cpp -I /home/shravan40/cryptopp/build -lcryptopp #include <iostream> #include <cryptopp/rsa.h> #include <cryptopp

AES128 in CBC mode implementation using Crypto++ library

99封情书 提交于 2019-12-13 13:39:09
问题 In the input file I have: on the first line a key which is encoded in hex and with length of 16 bytes; on the second line encrypted message ( AES128 in CBC mode , with a random iv prepended to the encrypted message). This is how I tried to decrypt: #include<iostream> using namespace std; #include <fstream> #include <string.h> #include <cryptopp/aes.h> #include <cryptopp/modes.h> #include <cryptopp/filters.h> using namespace CryptoPP; int main(void) { ifstream in("input0.txt"); ofstream out(

crypto++ RSA and “invalid ciphertext”

你离开我真会死。 提交于 2019-12-13 02:21:56
问题 Well, I've been going through my personal hell these days I am having some trouble decrypting a message that was encrypted using RSA and I'm always failing with a "RSA/OAEP-MGF1(SHA-1): invalid ciphertext" I have a private key encoded in base64 and I load it: RSA::PrivateKey private_key; StringSource file_pk(PK,true,new Base64Decoder); private_key.Load( file_pk ); I then proceed to decode the message by doing: RSAES_OAEP_SHA_Decryptor decryptor(private_key); AutoSeededRandomPool rng; string

How to configure Crypto++ in Eclipse?

安稳与你 提交于 2019-12-13 00:46:17
问题 I want to use Crypto++ in Eclipse. I've installed it correctly but I dunno why it cannot find the path. using namespace CryptoPP; Symbol CryptoPP cannot be resolved and if I use #include "aes.h", for example is an unresolved inclusion. How can I solve this? 回答1: You have to set the include paths for your project. Assuming you are using CDT go to "Project->Properties->C/C++ Build->Settings" and now in your configured compiler to "Includes" and add the path to your library. The same has to be