crypto++

Get hexadecimal encrypted string in AES 256 Crypto++

瘦欲@ 提交于 2019-12-31 04:26:58
问题 I am trying to implement the AES 256 algorithm using Crypto++ in MS visual studio. Operating system is Windows 7 (64 bit). I need to provide the key as a hexadecimal string, password as string and finally i want the encrypted string to also be hexadecimal string. Here is what I am trying to do: My encrypt method: std::string encrypt(const std::string &password) { std::string plain = password; std::string ciphertext; char * decodedKey=

How to convert CryptoPP::Integer to char*

£可爱£侵袭症+ 提交于 2019-12-31 01:45:10
问题 I want to convert myVar from CryptoPP:Integer to char* or to String : The code is below : CryptoPP::Integer myVar = pubKey.ApplyFunction(m); std::cout << "result: " << std::hex << myVar<< std::endl; I have been searching the Internet for converting CryptoPP:Integer to char* but I have had no luck finding. So, either it is really a problem with all to convert CryptoPP:Integer to char* , either I didn't understand very well type CryptoPP:Integer within C++ . Can someone help me please? 回答1: One

unresolved external symbol, but dumpbin says it's ok

こ雲淡風輕ζ 提交于 2019-12-31 01:33:35
问题 I downloaded Crypto++ 5.62 and built it with default project settings. In my project I set up the path to cryptopp.lib and defined its name in "Additional Dependencies". Both Crypto++ and my project - VS 2008. During building of my project I get: main.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const CryptoPP::DEFAULT_CHANNEL" (?DEFAULT_CHANNEL@CryptoPP@@3V?$basic_string@DU?$char_traits@D@std@@V?

Undefined symbols for architecture x86_64 when building for ARM64

喜欢而已 提交于 2019-12-30 11:54:32
问题 I built the cryptopp lib to using for an ios application. but isn't working , only told me "Undefined symbols for architecture x86_64: "CryptoPP::ProxyFilter::IsolatedFlush(bool, bool)", referenced from: " and on and on... and I follow the Crypopp wiki page's guideline, but it still crashing. how can I fix that? ld: warning: ignoring file [path]/libcryptopp.a, missing required architecture x86_64 in file [path]/libcryptopp.a (4 slices)CryptoPP::ProxyFilter::IsolatedFlush(bool, bool)",

AES 256 encryption - Qt equivalent for Java

两盒软妹~` 提交于 2019-12-30 05:05:56
问题 I have my AES 256 encryption method implemented and working fine in Java as follows! private static final byte[] IV = { 0, 2, 4, 8, 16, 32, 64, 127, 127, 64, 32, 16, 8, 4, 2, 0 }; //actual encryption over here private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); Cipher cipher = null; if(isIVUsedForCrypto) { cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, new

AES 256 encryption - Qt equivalent for Java

为君一笑 提交于 2019-12-30 05:05:04
问题 I have my AES 256 encryption method implemented and working fine in Java as follows! private static final byte[] IV = { 0, 2, 4, 8, 16, 32, 64, 127, 127, 64, 32, 16, 8, 4, 2, 0 }; //actual encryption over here private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); Cipher cipher = null; if(isIVUsedForCrypto) { cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, new

Calculate time encryption of AES/CCM in Visual Studio 2017

孤人 提交于 2019-12-29 02:14:08
问题 I am using the library Crypto++ 5.6.5 and Visual Studio 2017. How can I calculate the encryption time for AES-CCM? 回答1: I would like to know how to calculate the encryption time for AES-CCM. The Crypto++ wiki provides an article Benchmarks. It provides a lot of details regarding library performance, how throughput is calculated, and it even references the source code where the actual throughput is measured. Believe it or not, a simple call to clock works just fine to measure bulk encryption.

How to convert SecByteBlock to string?

自作多情 提交于 2019-12-28 06:50:29
问题 I'm having a problem trying to convert SecByteBlock to string. Here's my case: I want to encrypt user access data using AES with static key and dynamic iv. My code is something like this: AesKeyIvFactory aesKeyIvFactory; SecByteBlock key = aesKeyIvFactory.loadKey(); SecByteBlock iv = aesKeyIvFactory.createIv(); encryptionService->encode(&userAccess, key, iv); std::string token = std::string(iv.begin(), iv.end()) + userAccess; The code above is supposed to: Load key from file; Create iv;

Problems with CryptoPP C++ AES-256+Base64

筅森魡賤 提交于 2019-12-25 17:18:06
问题 could someone please tell me as to why the decryption starts to mess up. It works fine with short strings but it will mess up as you can see as it goes on. I THINK it has something to do with the string conversions. std::string encrypt(const std::string& str_in, const std::string& key, const std::string& iv) { std::string str_out; CryptoPP::CFB_Mode<CryptoPP::AES>::Encryption encryption((byte*)key.c_str(), key.length(), (byte*)iv.c_str()); CryptoPP::StringSource encryptor(str_in, true, new

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

╄→гoц情女王★ 提交于 2019-12-25 04:48:05
问题 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 garbage redundancy text like 'ð', at the end of the decrypted text. This extra part is random generated each time I run the code. Is there something wrong in my code? Encrypt a string to a string string encryptString(string plain, byte key[], int sizeKey, byte iv[], int sizeIV){ string cipher; try{ CTR