Newest 'crypto++' Questions

Q&A for professional and enthusiast programmers

Crypto++ DES implementation and the key length

I've been looking for a crypto library for C++ for a while, and finally came across Crypto++. The library seemed OK until I tried to use 3DES. The problem is that the key length for DES algorithm ...

Exception “AES: 4 is not a valid key length” on BegleboneBlack

I installed Crypto++ on BeagleBone black by following native installation method provided at ARM (Command Line). Then when I ran cryptest.sh, it runs smoothly. Here is my small test-code to test ...

ECIES with AES and CBC in Crypto++

I need to implement in Crypto++ the equivalent to BouncyCastle's "ECIESwithAES-CBC/NONE/PKCS7Padding". The main reason is that I need to encrypt data on iOS and decrypt it on the backend with ...

Exception thrown: write access violation. this was 0xDDDDDDDD

I'm trying to encrypt a string using AES encryption provided by Crypto++ library API, version 5.6.0, linked statically string AESEncryptor::encrypt(const string& plain) { string ...

Garbage at end of file after encryption and decryption

I am trying to encrypt and decrypt a file (a text or whatsoever), so I decided to use the Crypto++. Below is my code. crypt.h: #ifndef CRYPT_HPP_ # define CRYPT_HPP_ # include <crypto++/aes.h>...

Crypto++ DefaultEncryptor/DefaultDecryptor scheme

I am trying to encrypt a file using AES with crypto++. I can see the functions EncryptFile and DecryptFile which use DefaultEncryptorWithMAC/DefaultDecryptorWithMAC from test.cpp in crypto++. void ...

Creating an Encryption Function using Crypto++ [closed]

The following code is used for encrypting and encrypting a textual data stored in the string "plain" using the AES with CBC, and it measures the CPU ticks elapsed during the encryption/decryption ...

Skip'ing on a Source does not work as expected

I use Crypto++ 5.6.3 and iI need the FileSource Skip(...) function. Unfortunately this function does nothing! Here is a example for this function. string filename = ...; string str; FileSource file(...

Using crypto++ library with MSVS 2013 [duplicate]

I've downloaded Crypto++ library which contains cryptopp.dll and cryptopp.lib files. But I don't know how to use them in my project. I've tried to add cryptopp.lib to linker and cryptopp.dll to exe ...

Crypto++ equivalent to PHP mcrypt_encrypt MCRYPT_3DES/MCRYPT_MODE_CBC

I have the following PHP code to encrypt a text using a key: function des_ed3_crypt($msg, $key) { $bytes = array(0,0,0,0,0,0,0,0); $iv=implode(array_map('chr', $bytes)); return ...

How to save encrypted FileSource data to byte array?

This is the code of Crypto++ FileSource to encrypt a large file. Its works perfectly but all in blackbox and doesn't allow me to save encrypted data to a byte array when encrypting. I want to know the ...

Can't BER decode RSA public key with NDK Android

I have problems using Crypto++ to save a RSA public key string. When decoding the key, I always get a BERDecodeErr exception. Code: string RsaEncryptor::encryptor(string plaintext, string publicKey) ...

Advantages of SecByteBlock class from Crypto++

I am using Crypto++ library to decrypt files with AES algorithm in CBC mode. I came across SecByteBlock class in sample code of AES which says The key is declared on the stack using a SecByteBlock ...

HashVerificationFilter: message hash or MAC not valid Error on modified GCM AE code

I am referring to sample code on Crypto++ wiki at CCM Mode. I have done few modifications for testing purposes and now it is throwing: terminate called after throwing an instance of '...

Passing RSA keys between Java and Crypto++ code

I have a server written in java that generates RSA key pair. I want to use the private key in a C++ client for decryption. This is the code I use to create the private key: KeyPairGenerator keyGen = ...

Gargage redundancy character at the end of original text when decrypt using Crypto++

I am using Crypto++, CTR mode, to encrypt and decrypt text in C++. Everything seem to worked 99%. Ecrypting success, decrypting is give back the original text too, but I given some extra random ...

Calculating CRC of file as numeric value using Crypto++

I am receiving file along with its CRC which is numeric value. I must recalculate CRC on received file and compare it. I am using Crypto++ but it didn't give me numeric value. Please let me know how ...

How to create a HMAC 256 using the Crypto++ library?

I have a string which I need to encode in HMAC 256 using C++ and Crypto++. The code from the library wiki: AutoSeededRandomPool prng; SecByteBlock key(16); prng.GenerateBlock(key, key.size()); ...

Android and Crypto++ AES 128bit encrypted results not matching

I am trying to use the same key and VI to encrypt and decryp the same message, say aabbcc@gmail.com. The key length is 128 bit as I know that in Java/Android, 256 is not easy to implement. Here is my ...

Encrypt with Crypto++ and Decrypt with Python.CRYPTO

I'm working on a project that uses Crypto++ to encrypt some data using RSA. Here is my Crypto++ code: string plain = "Text123", encoded, cipher; string pkey = "..."; StringSource ss1(pkey, true); ...

Manual CBC encryption handing with Crypto++

I am trying to play around with a manual encryption in CBC mode but still use Crypto++, just to know can I do it manually. The CBC algorithm is (AFAIK): Presume we have n block K[1]....k[n] 0. cipher ...

Memory leak in Crypto++ RSAES class

I'm trying to learn how to use Crypto++ classes. My goal is to generate public and private keys for RSA encryption and then do basic encryption and decryption of a plaintext. So I'm taking their ...

Cryptography - Bizzare behaviour in Release mode

I've got a project using Crypto++. Crypto++ is a own project which builds in a static lib. Aside from that I have another large project using some of the Crypto++ classes and processing various ...

Crypto++ CTR mode manual implement

I am trying to make CTR manually on top of ECB mode (but still) using Crypto++. The idea is: For single block: Just use ECB For multiple block, use CTR algorithm (AFAIK): //We have n block of ...

std::string.c_str() causes access violation 0xC0000005

I have a problem with crypto++ 5.6.4 (VS2010) exception.code throws an exception in RSaVerifyVector function (in decoder.Put line): bool RsaVerifyVector(const std::string& publicKeyStrHex, ...

“Mutex” Error when using Cryptopp with Windows Forms

I'm using Visual Studio 2015 An CLR application and I added a UI windows form I want include some Crypto++ functions into my Form header file so I add these lines after #pragma once #include <...

File Encryption with AES in Java decrtypion in C++ using cryptopp

I'm experimenting with Crypto++ library and javax.crypto library. So what I'm trying to do is... encrypting a text file using AES with CFB mode in java, and then decrypt the encrypted file using ...

Generating an ONVIF authentication digest using Crypto++?

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 ...

Error: <memory> no such file or directory on Android with JNI

I am trying to compile Crypto++ library on Android using JNI. I have cloned the project of https://github.com/morgwai/ndktutorial. I imported the project into android studio, I am able to call the JNI ...

How to convert base64 to Integer in cryptopp?

I use cryptopp library and I have a base64 string saved as CString. I want to convert my string to Integer. actually this base64 built from an Integer and now i want to convert to Integer again.but ...

Saving Crypto++ objects to std::vector

I want to save Crypto++ keys to std::vector<uint8_t>. Unfortunately there is only CryptoPP::StringSink, that takes std::string reference but no CryptoPP::VectorSink that would take a reference ...

Encrypt big char* using std::string with Crypto++

I am new with Crypto++. I want to using Crypto++ library to encrypt/decrypt a large byte array in C++. The data can be anything, so asume its binary format. First, I tried with "byte array" (char * or ...

Which class for cryptopp library is better for decryption using AES algorithm in CBC mode [duplicate]

I am trying to decrypt a file encrypted using AES algorithm in CBC mode with PKCS padding. I found two classes in cryptopp library which can do it and not sure which one is better. Please suggest me ...

Convert byte* {aka unsigned char*}’ to ‘byte [32] {aka unsigned char [32]}

I am using Crypto++ Salsa20 as a part of my project. The above link has an example code in which they define byte key[32]; So I have a string of 64 bytes. I got this value from SHA256. Basically ...

How to use crypto++ code in web

I downloaded a sample code in crypto++ library. I tested that code and it returns a group of HEX code as a result. I want to send users id as a encrypted text to browser. When I get request for ...

Crypto++ is not decrypting an encrypted file

I got the requirement to decrypt the input file using AES algorithm in CBC mode with given key. I tried to encrypt a sample file using AES algorithm in CBC mode using online tool AES – Symmetric ...

Trouble Verifying Message RSA Signature Scheme Over Sockets

Im trying to send signed messaged from my server over a socket to a client. I am having trouble verifying the messages. I have tried the filtered and non filtered way based off of the code examples ...

Crypto++ Init-Update-Final get cipher output

In a effort to encrypt large file using Crypto++, I am following ecrypting using Java-like Init-Update-Final in Crypto++, The demo code seem to work, everytime the Put is invoked, the output byte is ...

Effecient way for encrypt large data using Crypto++

I am looking for a solution to encrypt/decrypt a very large file (some GBs) using Crypto++. Several days ago, I was thinking about using StringSource in this question, read whole file into a char ...

error: ‘GlobalRNG’ was not declared in this scope

So i'm using Crypto++ to encrypt files in c++ And i'm using this code over here It doesn't contain the headers files so I added my own : #include <iostream> #include <string> #include &...

Cannot pass AutoSeededRandomPool as parameter when using CryptoPP::RSA, error C2729

I am working with implement RSA using Crypto++. I am trying to generate a pair of RSA keys (public and private) to file like this. The code can run perfect when I put all in main. When I try to split ...

Qt Crypto++ LNK2019 LNK1120 Error

I am trying to include Crypto++ dynamic library make with MSVC in qt project, the include work and the "#include dll.h, #include md5.h" don't make error but when i'm trying to do "CryptoPP::MD5 mdd;" ...

How to seek in CTR mode and decrypt part of the stream?

I have a question in partial decoding in cryptopp. USE AES 256 CTR; Encode source: CTR_Mode< AES >::Encryption e; e.SetKeyWithIV(key, 32, iv); string encrypt; string a = "Example text to ...

Getting warning while compiling using cryptopp library

I have a encrypted file using AES algorithm in CBC mode. I have key from database. I am trying to compile below code using cryptopp 5.6.2 library. It gets compiled without -Wall flag but when I enable ...

C++ JWT Crypto++ Empty Signature

I want to generate a JWT (jwt.io) token using Crypto++ but I am getting a empty signature. I am on a OSX 10.12, XCode 8.1. I have generated a 2048 bit RSA key pair with "ssh-keygen -t rsa -b 2048 -f ...

Custom source for Crypto++

I have made my own custom stream classes for binary I/O. Now I'm trying to make them compatible with Crypto++ library. I have found a question that deals with custom sink and implemented my own. Now I ...

Omnet++ framework and linking Crypto++

Can you help me with the steps to link/import Crypto++ library to OMNeT++ framework properly, please. I use OMNeT++ 5.0/inetmanet 3.0 version (Windows 10).

Missing symbols Rijndael::Enc::ProcessAndXorBlock and Rijndael::Dec::ProcessAndXorBlock

I am trying to compile a code for AES however I get an error when i try to do it. The code is given below: #include <iostream> #include <iomanip> #include "modes.h" #include "aes.h" #...

warning: libcryptopp.so: is missing DT_SONAME will use basename as a replacement

I am trying to build libcryptopp.so and include it in my JNI code, follow the guide in Android Crypto++, I experienced the following problems. Missing symbol problems in Crypto++ 5.6.3 Originally I ...

InvertableRSAFunction Fails on encrypting Diffie-Hellman Keys as const byte*

Before we begin here, I have a server and a client. I wish to send an encrypted string to the client that contains the server's Diffie-Hellman public static key and public ephemeral key. To do so, I ...
Translating... 0%