Newest 'crypto++' Questions

Q&A for professional and enthusiast programmers

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

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

How to cast a char* to a byte* in c++?

I am very new in c++ and want to cast a char* from a std::string to a byte*. Here is my code: inline string XOR(const string &value, const string &key) { string retval(value); CryptoPP::...

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

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

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

How to encrypt and decrypt a folder including all files? [on hold]

I am confused of how to encrypt bunch of files and folders all into one file. I don't see any examples of doing such thing. As well, companies are doing this by adding them all into one file XXX.dat, ....

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

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

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

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

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

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

Array parameter getting decayed

I am trying to pass 2 byte arrays to a file encryption function I wrote. However, when I do both arrays are truncated to size 8 (from size 16) thus causing the function to not work properly. I am not ...

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

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

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

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

Convert CryptoPP::Integer to LPCTSTR [duplicate]

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 !

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

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

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

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

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

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

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++ Lib in C#

I am using the Crypto++ library for using various encryption algorithms. I know the library is written using c++ as the language, but I want to use the SAME library in C#. How can I convert this ...

c++ CryptoPP - encrypt / decrypt with RC6

I want to encrypt and decrypt strings with RC6 but I don't understand how it works with the CryptoPP library, could you give me a snippet ? Thanks you !

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

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

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

Encrypt/Decrypt byte array Crypto++

I am trying to encrypt a byte array using AES. I have been able to encrypt strings and files no problem, however byte arrays seem to not be working for me. I pass in a byte array to be encrypted, for ...

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

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

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

Why AES code in Crypto++ gives different performance results?

I am trying to test performance of AES encryption. But whenever I am running the code it is giving different results.Why? Here's the code in C++ using Crypto++: int main(int argc, char* argv[]){ ...

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

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

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

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 can I do XOR operation in Crypto++?

I want to perform XOR operation in AES before and after encryption in AES (like DESX) with new keys. But XOR operation takes too much time. How can I reduce the XOR operation time? Here is my code: ...

Why AES-128 performance is not %40 better than AES-256

I am making performance tests over AES-128 and AES-256. But my results are around %20. I am using Intel Core 2 Duo 800 MHz. 2.60 GHz. 6 MB Cache Memory T9500 CPU and Linux Mint 17.2 Rosa Xfce Os. Is ...

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

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

Convert encoded std::string from Base16 to Base10? [closed]

I have a std::string with a large integer encoded in Base16: bbb91c1c95b656f386b19ab284b9c0f66598e7761cd71569734bb72b6a7153b77613a6cef8e63 ...

Crypto++ explicit destruction during encryption/decryption?

I wrote some wrapper functions to encrypt/decrypt files using crypto++. I tried looking in the wiki but could find my answer. I am wondering if I need to explicitly destroy my objects that are created?...

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 ...
Translating... 0%