Newest 'crypto++' Questions

Q&A for professional and enthusiast programmers

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

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

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

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

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

How to load Base64 RSA keys in Crypto++

I'm trying to write helper functions for a program I'm making and I need to return the keys as strings. Found a way to convert the RSA keys from PrivateKey/PublicKey to Base64 string. int main() { ...

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

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

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

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

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

GCC and Crypto++ on makefile

I'm trying to compile C++ project with gcc-make command but program giving this error. I already compiled Crypto++ and added include and lib folder but I dont know how to add this dir to gcc. What ...

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

Decrypting Crypto++ RSA cipher text in C# causes exception

I've written 3 functions in C++ using Crypto++ to generate key pairs, encrypt and decrypt a string. Crypto++ side: //Decode public key RSA::PublicKey pbKeyDecoded; StringSource ss2(publicKey, true, ...

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

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

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

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

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

Converting Node.js HMAC to C++

Ive been working on a project, and as part of it I need to convert the Node.js code var hash = crypto.createHmac('sha512', key).update(text).digest('hex'); to C++. I've decided to use Crypto++, ...

How to convert base64 to Integer in Crypto++?

I use Crypto++ library. 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 two ...

Crypto++ Lib in C#

i am using Crypto++ library for using various encryption algos. Now i know the library is using c++ as a language.. but i want to use the SAME library in C#.. how to convert this library code to c#...

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

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

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

Using (Crypto++) Blowfish implementation to implement Bcrypt

I am implementing a password storing system and currently seeking to have Bcrypt hashing support. As I already use Crypto++ for other stuff and it has a solid implementation of Blowfish, and from what ...

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

type cast CryptoPP::Integer to int

I don't have any experience of Crypto++ library. In my project I need to typecast Integer to int. This is what I am trying: int low_bound1=8; int low_bound2=9; Integer x=1,y=2; low_bound1=(int)x; ...

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

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

StreamTransformationFilter: ciphertext length is not a multiple of block size?

I am trying to encrypt and decrypt a plain text using aes algorithm present in crypto++ Here is my encryption method /* * Encrypt the given text */ template<typename T> T encryptText(T ...

How to change sink in Crypto++

I'm using Crypto++ to decrypt a file, so I use FileSource as my source but I want to be able to change sink, so I can achieve something like following: std::string temp; FileSource file("/path/to/...

Installing Crypto++ with Visual Studio

I have a issue with installing Crypto++. Basically the most recommended way to install it is to use Visual studio. But every time I generate the solution, I got this error message : I tried Visual ...

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

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

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

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

How to sync Crypto++ RSA with C# RSA crypto service provider?

I crypt a string text with use of Crypto++, but when want to decrypt it by C# RSA crypto service provider I have an exception. My code produces same cipher string when encrypt a same string with ...

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

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

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

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

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

Crypto++ hangs on CentOS 6.6

I have copied the below code directly from Crypto++ website, this is perfectly executed on Ubuntu 14.04. When it runs on CentOS 6.6, it compiles without any problem but when executed, it hangs. I am ...

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

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

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

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

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

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

How to initialize AES-256 key with user defined password

What if I want to encrypt data, using the Crypto++ library and having a user defined password that is shorter then 32 Byte? Right now I have the following code: byte passwordBytes[AES::MAX_KEYLENGTH]...
Translating... 0%