libgcrypt

How do I decrypt an AES key using C# Bouncy Castle that was encrypted using Libgcrypt raw flag

你离开我真会死。 提交于 2019-12-24 19:58:56
问题 Summary: I am attempting to decrypt (and eventually encrypt and return) files that are AES128 encrypted. The AES key is encrypted using libcrypt's RSA provider. When I attempt to decrypt the AESKey on Windows 7 using C# & BouncyCastle a "block truncated" error is thrown when I call "ProcessBlock". I have tried converting the data to BigEndian and I'll get a "Not a valid RSA exponent" when I try to create the RsaKeyParameters. The encryption was done using libgcrypt 1.2x on a linux system. I

C Libgcrypt: Unable to check if number is prime using libgcrypt

喜你入骨 提交于 2019-12-13 02:57:18
问题 I am using a libgcrypt function gcry_prime_check to test if the number 3 is a prime number. It turns out 3 is not a prime number according to my the function. What am i doing wrong? Here is my code #include <gcrypt.h> #include <stdio.h> int main(void) { gcry_mpi_t cript_prime; gcry_error_t err; char buffer[8] = {0}; char number[8] = {0}; printf("%s\n", gcry_check_version ( NULL ) ); gcry_control( GCRYCTL_INIT_SECMEM, 16384, 0 ); cript_prime = gcry_mpi_new(16); strcpy(number,"3"); gcry_mpi

Compression and Encryption… Which to apply first?

时光怂恿深爱的人放手 提交于 2019-12-13 01:41:48
问题 I am working on a remote backup project in C... I want to send data and compress as well as encrypt the data. However I am confused whether to compress first or encrypt first! What will be better?: Compress the data and then encrypt it Encrypt the data and then compress it Also I am going to use zlib for compression. And I am wondering which encryption lib to use... Some people say libgcrypt is good. Suggestion for good encryption libraries(very easy to use) will be appreciated... :) or is

AES128 in libgcrypt not encrypting

别来无恙 提交于 2019-12-11 03:03:51
问题 I've been trying to the libgcrypt for a small cryptography project of mine, but I can't seem to be able to implement the en/decryption correctly. The following the class and the usage of it. #include <iostream> #include <string> #include <cstdlib> #include <gcrypt.h> #include "aes.h" #define GCRY_CIPHER GCRY_CIPHER_AES128 #define GCRY_MODE GCRY_CIPHER_MODE_ECB using namespace std; aes::aes(string a) { key = a; keyLength = gcry_cipher_get_algo_keylen(GCRY_CIPHER); gcry_control (GCRYCTL_DISABLE

Steps to decrypt encrypted data in Crypto++ in libgcrypt

六月ゝ 毕业季﹏ 提交于 2019-12-11 01:59:30
问题 I need to decrypt the encrypted data by Crypto++ in libgcrypt due to C language restriction on target platform. So I've decided to use libgcrypt since it supporting the AES128 and GCM mode. In Crypto++, the data is encrypted this way: std::string encrypt_data(const std::string &data, const std::vector<unsigned char> &iv, const std::vector<unsigned char> &key) { CryptoPP::GCM<CryptoPP::AES>::Encryption encryptor; encryptor.SetKeyWithIV(&key[0], key.size(), &iv[0]); std::string ciphertext;

Unresolved external symbol in libgcrypt.lib

ぃ、小莉子 提交于 2019-12-07 12:22:27
问题 What I have to do if i found Unresolved external symbol in .lib(library) file. If I found unresolved external symbol in .c or .cpp I can fix it. But when i found Unresolved external symbol in .lib(library) file how can i solve this? In my case i found a linker error like this: Error 1 error LNK2019: unresolved external symbol ___mingw_vfprintf referenced in function _fprintf D:\VidPlaya_offline\TryingToIncludeUpdateFacility\Vidplaya_Plugin_EmbeddedUpdate\vlcwin\libvlccore\libgcrypt.lib

Determine size of decrypted data from gcry_cipher_decrypt?

给你一囗甜甜゛ 提交于 2019-12-02 19:17:28
问题 I am using AES/GCM, but the following is a general question for other modes, like AES/CBC. I have the following call into libgcrypt : #define COUNTOF(x) ( sizeof(x) / sizeof(x[0]) ) #define ROUNDUP(x, b) ( (x) ? (((x) + (b - 1)) / b) * b : b) const byte cipher[] = { 0xD0,0x6D,0x69,0x0F ... }; byte recovered[ ROUNDUP(COUNTOF(cipher), 16) ]; ... err = gcry_cipher_decrypt( handle, // gcry_cipher_hd_t recovered, // void * COUNTOF(recovered), // size_t cipher, // const void * COUNTOF(cipher)); //

Determine size of decrypted data from gcry_cipher_decrypt?

孤人 提交于 2019-12-02 11:49:39
I am using AES/GCM, but the following is a general question for other modes, like AES/CBC. I have the following call into libgcrypt : #define COUNTOF(x) ( sizeof(x) / sizeof(x[0]) ) #define ROUNDUP(x, b) ( (x) ? (((x) + (b - 1)) / b) * b : b) const byte cipher[] = { 0xD0,0x6D,0x69,0x0F ... }; byte recovered[ ROUNDUP(COUNTOF(cipher), 16) ]; ... err = gcry_cipher_decrypt( handle, // gcry_cipher_hd_t recovered, // void * COUNTOF(recovered), // size_t cipher, // const void * COUNTOF(cipher)); // size_t I cannot figure out how to determine what the size of the resulting recovered text is. I've

Cross-compile to static lib (libgcrypt) for use on iOS

血红的双手。 提交于 2019-11-29 04:33:21
I have downloaded latest libgcrypt & libgpg-error libraries from https://www.gnupg.org/download/index.html . I have successfully built (command line) both libraries using ./configure --enable-static --disable-shared; make ; make install on my Mac (Mavericks w/OSX 10.10 & latest Xcode 6.1). I can link just fine to these new libs from an OS X client app I am building. So far, so good. Just perfect. BUT, I also need to build an iOS client using same exact source code. Questions: 1) What are the modifications to the command line build sequence for the library I would need to build a universal

Cross-compile to static lib (libgcrypt) for use on iOS

大兔子大兔子 提交于 2019-11-27 18:20:16
问题 I have downloaded latest libgcrypt & libgpg-error libraries from https://www.gnupg.org/download/index.html. I have successfully built (command line) both libraries using ./configure --enable-static --disable-shared; make ; make install on my Mac (Mavericks w/OSX 10.10 & latest Xcode 6.1). I can link just fine to these new libs from an OS X client app I am building. So far, so good. Just perfect. BUT, I also need to build an iOS client using same exact source code. Questions: 1) What are the