crypto++

Rebuild Crypto++ 5.6.2 for /MD release under Visual Studio 2013

霸气de小男生 提交于 2019-12-25 02:57:46
问题 I want to rebuild Crypto++ via MSVC 2013 so when I am using the library to be able to build my project with /MD or /MDd, NOT /MT or /MTd, because I am using QT 5.5.1 with MSVC2013 32bit compiler and it seems if I want to make GUI interface - it is using /MD or /MDd! In this article in section Static Versus Dynamic Linking is mentioned the necessity for rebuilding (not building) and how you can see from my other question I did it, but it is only working for debug mode. For Release mode the

Building and linking test code for Crypto++

早过忘川 提交于 2019-12-25 00:19:54
问题 I'm trying to write some simple test code for the Crypto++ library for a project. I have yet to manage to get my own code to build though. It compiles fine, the problem comes in linking. I'm still pretty new to Visual Studios, but I'm using VS10. The errors I'm getting are: 1>sec_test.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::DES::Base::ProcessAndXorBlock(unsigned char const *,unsigned char const *,unsigned char *)const " (?ProcessAndXorBlock

'message hash or MAC not valid' exception after decryption

戏子无情 提交于 2019-12-24 13:15:49
问题 I'm trying to make a program that encrypts files (.jpg and .avi) using the crypto++ libraries. My aim is to make a program that successfully encrypts video files using AES-256. I did text examples of AES encryption from here and they ran successfully (meaning that the library is setup correctly). However, the following simple code produces the exception HashVerificationFilter: message hash or MAC not valid Code: AutoSeededRandomPool prng; SecByteBlock key(AES::DEFAULT_KEYLENGTH); prng

CryptoPP: how to use SocketSource and SocketSink

倾然丶 夕夏残阳落幕 提交于 2019-12-24 13:13:42
问题 I'm trying to send a string via SocketSource and SocketSink. But somehow it won't work properly. I simply want to send it from my server to the client. Here's the code: Server: CryptoPP::Socket server; CryptoPP::Socket client; sockaddr_in client_sadr; CryptoPP::socklen_t size_sock = sizeof(sockaddr_in); timeval timev = {3, 0}; std::string test("a simple test"); CryptoPP::Socket::StartSockets(); server.Create(SOCK_STREAM); server.Bind(4213, NULL); server.Listen(); server.Accept(client,

Convert CryptoPP::Integer to LPCTSTR [duplicate]

自古美人都是妖i 提交于 2019-12-24 06:08:09
问题 This question already has answers here : How to convert CryptoPP::Integer to char* (4 answers) Closed 2 years ago . I can't find the right code to convert a CryptoPP::Integer (from a RSA key generation) to a LPCTSTR (I want to store the key in the registry). Could you help me ? Thanks you ! 回答1: ... convert a CryptoPP::Integer (from a RSA key generation) to a LPCTSTR (I want to store the key in the registry). Could you help me ? Something like the following should do. The Integer class

Converting QString/QChar to be accepted with Crypto++

痴心易碎 提交于 2019-12-24 01:43:48
问题 I want to make program that encrypts (later decrypts) user inputted string. Here is beginning for encryption: QString getData = ui->text->toPlainText(); //Data to process std::string output; //Result will be Base32 encoded string, so std::string is fine. Now, I have to convert QString to char* or std::string so it can be accepted with Crypto++. I thought that QByteArray would be fine, as it has .data() function, which returns char * . ( getData always 17 or more bytes long: CryptoPP requires

cryptopp foreign library dependency

天涯浪子 提交于 2019-12-23 21:13:06
问题 I tried to install happstack-server-tls package via cabal on Arch Linux (3.12.9), but got this error: Resolving dependencies... Configuring happstack-server-tls-7.1.0... Failed to install happstack-server-tls-7.1.0 Last 10 lines of the build log ( /home/boris/.cabal/logs/happstack-server-tls-7.1.0.log ): Configuring happstack-server-tls-7.1.0... /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) setup-Cabal-1.16.0-x86_64-linux-ghc-7.6.3: Missing dependency on a foreign

Inplace AES CBC/ECB mode encrypting/decrypting using Crypto++

大憨熊 提交于 2019-12-23 19:34:08
问题 Is it explicitly allowed to use the same buffer for plaintext/ciphertext when performing AES encryption/decryption in CBC and ECB modes using Crypto++ (assuming the buffer size is sufficient to accomodate the encrypted data) as in the following code: #include <cstdio> #include <cassert> #include "cryptopp\rsa.h" #include "cryptopp\rijndael.h" #include "cryptopp\modes.h" int main() { using namespace CryptoPP; byte key[32], iv[Rijndael::BLOCKSIZE]; char testdata[] = "Crypto++ Test"; // any data

Crypto++ AES Decrypt how to?

痞子三分冷 提交于 2019-12-23 18:59:55
问题 There are next to no noob guides to crypto++ out there. Or none that I've found anyway. What I want to do is decrypt an array of uchars I generate with another AES encrypter. Where would I start? I have the library built and linking grand. Do I need to set anything up or do I just call a function on my array (and if so what function) ? I'd really appreshiate some help from someone who knows this stuff. Thanks 回答1: I wouldn't say I "know my stuff" too much about this, but here's some test code

ElGamal encryption example?

和自甴很熟 提交于 2019-12-23 15:41:43
问题 I apologise in advance for the n00bishness of asking this question, but I've been stuck for ages and I'm struggling to figure out what to do next. Essentially, I am trying to perform ElGamal encryption on some data. I have been given the public part of an ephemeral key pair and a second static key, as well as some data. If my understanding is correct, this is all I need to perform the encryption, but I'm struggling to figure out how using Crypto++. I've looked endlessly for examples, but I