Questions tagged [libgcrypt]

73 questions
2
votes
2 answers

encrypt using BouncyCastle (java) and Gcrypt (C) gives different result

I wrote this simple Java program which encrypt a string and output the hex value of the iv, salt, derived key and cipher text. public class tmp{ static Cipher encryptionCipher; static String RANDOM_ALGORITHM = "SHA1PRNG"; static String…
polslinux
  • 1,739
  • 9
  • 34
  • 73
2
votes
3 answers

Steps to decrypt encrypted data in Crypto++ in libgcrypt

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…
smhaziq
  • 71
  • 1
  • 9
2
votes
1 answer

AES128 in libgcrypt not encrypting

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 #include #include…
MrDiggles
  • 748
  • 1
  • 5
  • 19
2
votes
2 answers

Key derivation using libgcrypt in C

I'm developing a simple software that do aes256-cbc file encryption. This software is developed on GNU/Linux using libgcrypt-1.5.0. I want to use the above function with GCRY_KDF_PBKDF2 as algo and SHA512 as subalgo. gcry_kdf_derive( const void…
polslinux
  • 1,739
  • 9
  • 34
  • 73
1
vote
0 answers

Why is the decryption process much faster than the encryption process in my AES256 CBC encryption program?

I have a C program which uses libgcrypt library to measure encryption and decryption speeds for AES256 CBC algorithm. The program works in this way: tries to decrypt/encrypt as much data as it could in 3 seconds. When done it calculates the overall…
user11729819
  • 107
  • 7
1
vote
1 answer

libgcrypt: Is CMAC an option?

Working with libgcrypt for a project, using the following settings to open a cipher handle: GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_GCM, GCRY_CIPHER_CBC_MAC Per the libgcrypt documentation: GCRY_CIPHER_CBC_MAC: Compute CBC-MAC keyed checksums. This is…
Ramrod
  • 378
  • 7
  • 18
1
vote
1 answer

Wrong ciphertext length in c libgcrypt

So, i am trying to encrypt and decrypt a string, using libgcrypt library (version 1.8.7) on arch and at this moment i have tried 2 modes: CBC and GCM (not sure about GCM, so let's solve the CBC first), but the same problem appears. I padd the string…
y0u4r3w3
  • 67
  • 3
  • 6
1
vote
1 answer

Libgcrypt - extract RSA encrypted data from a gcry_sexp_t object

I'm trying to extract the encrypted RSA data from a gcry_sexp_t object (which I assume is an MPI), so I could store the encrypted data as an encrypted file (without the other gcrypt metadata in the sexp object). I've tried using gcry_sexp_sprint,…
1
vote
1 answer

AES CCM Encryption and Decryption in Libgcrypt

I have a problem encrypting/decrypting a simple 16 byte message in Libgcrypt while using CCM mode of operation and AES algorithm. In the documentation of Libgcrypt I cannot find which parameters to set for CCM (should I set IV or counter?). I am…
1
vote
1 answer

How do I fix this libgcrypt cross-compilation error?

I'm trying to cross compile GPG for an ElinOS on a board with an imx6. I have a problem when I compile libgcrypt. First, here's what I do: export PATH=/opt/elinos/cdk/arm/v7hf/glibc/bin:$PATH ./configure --host=arm-unknown-linux-gnueabihf…
Stud
  • 21
  • 4
1
vote
0 answers

remove gnupg V.2.1.15 and libgcrypt V.1.7.8 then install gnupg V.2.1.0 and libgcrypt V.1.6.3

I use Lubuntu V.17.10 on my laptop. on this version of Lubuntu installed by default gnupg V.2.1.15 and libgcrypt V.1.7.8. I want to remove gnupg V.2.1.15 and libgcrypt V.1.7.8 then install gnupg V.2.1.0 and libgcrypt V.1.6.3. In the past, I…
quesN
  • 11
  • 1
1
vote
1 answer

AES256 Libgcrypt Invalid Key Length

I'm trying to encrypt and decrypt Files using AES256 from libgcrypt. (see doc) To generate the 256-Bit Key, I'm hashing a user-defined string (argv[1]) with SHA256. This works perfectly fine, but when using it as a key, the library fails with…
KillPinguin
  • 390
  • 4
  • 15
1
vote
0 answers

Unresolved symbols and types while using HashDRBG from libgcrypt in C

I have a problem using the HashDRBG from libgcrypt. My goal is to get some random data from a seed: outbuf <--- DRBG_HASHSHA512(seed) The only option I've seen so far is using libgrypt: …
Buzzy
  • 11
  • 3
1
vote
1 answer

openSUSE Linux: No Provider for libglib-dev libgcrypt-dev found

i try to install the packages libglib-dev libgcrypt-dev via sudo apt-get install ... on openSUSE Leap 42.2. The trouble is it claims, that there is "No provider of 'libglib2.0-devel' found." (same for libgcrypt-dev) Is it possible, that the packages…
JonasZZ
  • 13
  • 1
  • 3
1
vote
1 answer

gcry_pk_genkey function is extremely slow in libgcrypt

I am a newbie to libgcrypt version 1.6.1, and right now I am trying to produce a public/private key pair for rsa algorithm. I list the code I am using below. What I am trapped into is the gcry_pk_genkey function, in which it can take over 1.5 hours…
lllllllllllll
  • 8,519
  • 9
  • 45
  • 80