Questions tagged [libgcrypt]
73 questions
0
votes
0 answers
How to read RSA private key from file using a GPLv2 compatible library?
I need to do some RSA decryption and my private key is stored in a file.
I am using C++.
At first I used OpenSSL, and it worked smoothly, but then the licensing problem appeared, as I want my code to be GPLv2 compatible. Now I am trying to use…

simm
- 33
- 4
0
votes
0 answers
Mac OS C/C++ include issue
I recently installed libgcrypt from Gnu, but even with it inside my /usr/include and /usr/local/include directories I cannot compile a C++ file that includes it. It can't seem to locate the file, despite the fact that I have it in the correct…

noahbkim
- 528
- 2
- 13
0
votes
1 answer
Is there any way to represent 4 byte number as a 16 byte number?
I have to encrypt some data using a 4 byte IV. However, the encryption algorithm that I am using (AES128)needs a 16 byte (128 bit) key. Say, my code is as follows:
#include
void encrypt(){
int IV = 6174;
gcry_cipher_hd_t hd; …

TheRookierLearner
- 3,643
- 8
- 35
- 53
0
votes
0 answers
Error(s) generating password
I am using PBKDF2 to generate a key from a password using SHA-256
int genKeyFromPass()
{
int i;
void *pwd, *salt = "someRandomSalt";
unsigned char keyBuffer[16];
size_t saltLen, keySize = 16;
gpg_error_t errStatus;
…

TheRookierLearner
- 3,643
- 8
- 35
- 53
0
votes
1 answer
Comparing gcrypt MD5 outputs to a existing hash
I been given an MD5 output (a 16 byte hex string) and I need to figure out what the message used to make the hash was.
I want to compare it with the output of gcrypts gcry_md_hash_buffer(), but I'm sure how to declare it in such a way that strcmp()…

user3056261
- 95
- 1
- 2
- 4
0
votes
1 answer
What is libgcrypt doing different when calling the aes128 cipher with a 256bit key?
This is a continuation of my previous question (RSA Decryption).
Edit: The answer below was clear and concise. I've added some sample code below which has helped me verify what I think is happening. I will test today and post back. The client…

TheBrian
- 148
- 1
- 8
0
votes
1 answer
How do I decrypt an AES key using C# Bouncy Castle that was encrypted using Libgcrypt raw flag
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…

TheBrian
- 148
- 1
- 8
0
votes
1 answer
libgcrypt secure memory
From the libgcrypt manual:
Libgcrypt uses a concept known as secure memory, which is a region of
memory set aside for storing sensitive data. Because such memory is a
scarce resource, it needs to be setup in advanced to a fixed size.
Further,…

polslinux
- 1,739
- 9
- 34
- 73
0
votes
1 answer
gnutls configure error: checking for libgcrypt... no
I configured and compiled libgpg-error and libgcrypt but could not install(make install) as i donot have the root permissions.
When I try to configure libgnutls, i get this error.
tactuser@eqhttd01:gnutls-2.10.0 >./configure…

user862833
- 299
- 2
- 5
- 16
0
votes
1 answer
Memory leak in a program with Libgcrypt
I am doing some tests with Libgcrypt and when I use valgrind to check the memory usage there is 3,200 bytes in use at exit.
I have tried to use
valgrind --leak-check=full --track-origins=yes --show-reachable=yes ./my_program
But valgrind valgrind…

Tiago Queiroz
- 151
- 1
- 11
-1
votes
1 answer
sign with libgcrypt, crashes
im trying to create a peer to peer network that is controlled by a peer with the master private key, part of that is approving peers to connect
the following code is suppose to take a public key, sign that and send it to the peer so that it can…

Gabriel Lambert
- 1
- 3
-1
votes
2 answers
c aes256 padding with pkcs#7 standard
encrypt:
while(!feof(fp)){
memset(plain_text, 0, sizeof(plain_text));
retval = fread(plain_text, 1, 16, fp);
if(!retval) break;
for(i=0; i<16; i++){
if(plain_text[i] == 0){
for(j=i; j<16; j++){
…

polslinux
- 1,739
- 9
- 34
- 73
-2
votes
1 answer
Is libgcrypt thread-safe?
Is library libgcrypt thread-safe one? In case that I don't divide resources of this library between threads, but create different context in every thread. C++ programming language.

user3107137
- 15
- 1
- 3