Questions tagged [libgcrypt]
73 questions
7
votes
2 answers
Cross-compile to static lib (libgcrypt) for use on iOS
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…

Chris Heimark
- 73
- 1
- 3
7
votes
1 answer
aes-gcm using libgcrypt api in C
I'm playing with libgcrypt (v1.6.1 on Gentoo x64) and i've already implemented (and tested thorugh the AEs test vectors) aes256-cbc and aes256-ctr. Now i am looking at aes256-gcm but i have some doubt about the workflow. Below there is a skeleton of…

polslinux
- 1,739
- 9
- 34
- 73
5
votes
1 answer
How does libgcrypt increment the counter for CTR mode?
I have a file encrypted with AES-256 using libgcrypt's CTR mode implementation.
I want to be able to decrypt the file in parts (e.g. decrypting blocks 5-10 out of 20 blocks without decrypting the whole file).
I know that by using CTR mode, I should…

E1adi
- 77
- 4
5
votes
0 answers
Enabling FIPS causes libgcrypt error
I have two CentOS 6.7 machines (server A and B). Same package versions are installed on each system.
Last week I enabled the openSSH FIPS 140-2 module on Server A, and that system works flawlessly (including tsql queries to a SQL Server instance).…

a coder
- 7,530
- 20
- 84
- 131
4
votes
1 answer
Compiling libgcrypt and libgpgerror for Android with Cmake
For some code that has to be implemented in C(++) I need cryptographic functions like AES and 3DES en-/decryption. As openssl isn't an option for the Playstore anymore, so I had to choose a different library. My choice was libgcrypt.
Now I struggle…

nidomiro
- 820
- 2
- 10
- 24
4
votes
1 answer
Data loss when encrypting and decrypting using libgcrypt and Elgamal
I am using Libgcrypt with Elgamal to encrypt a block of bytes, and I am having 2 problems:
When I do not use padding and my block of bytes starts which an zero byte, I lose the first byte during decryption;
If I use padding the encryption works…

Tiago Queiroz
- 151
- 1
- 11
3
votes
2 answers
Unresolved external symbol in libgcrypt.lib
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…

Myanju
- 1,135
- 1
- 11
- 23
3
votes
3 answers
Encrypting a file from a password using libgcrypt
I'm developing simple software that does aes256-cbc encryption of a file. I'm using GNU/Linux and libgcrypt-1.5.0. The IV is randomly generated with the OpenSSL rand function and the IV is stored before the ciphertext in the output file. I'm using…

polslinux
- 1,739
- 9
- 34
- 73
2
votes
2 answers
C and libgcrypt. Str to type gcry_error_t. Then add
I am trying to convert a number in a string "255" to type gcry_mpi_t.
gcry_mpi_dump show me 323535 and than gcry_mpi_add and gcry_mpi_print(GCRYMPI_FMT_USG... ) doesn't work normal.
#include
#include
#include
#include…

c0nn3ct
- 155
- 1
- 1
- 7
2
votes
1 answer
How can we add pkcs1 padding for RSA encryption using libgcrypt?
I am trying to encrypt a string with RSA public key using libgcrypt. Its selftest_encr_1024 sample shows most of the things, but it does not show us how to handle padding. This is the code I wrote trying to add PKCS#1 type 2 padding, but it does not…

Harunobu Oyama
- 119
- 5
2
votes
3 answers
Libgcrypt in C returning 42
I would like to preface this with, I am new to C and especially using a lib as large as libgcrypt, so if it is something incredibly simple please be understanding.
So, I have been trying to just encrypt some text just to kinda launchpad from and so…

Sean Mitchell
- 447
- 2
- 21
2
votes
1 answer
Which is the best way to get *secure* input from user in C?
I'm developing a kind-of secure password manager. It won't be for professional use, and I know it won't be as secure as KeePass or anything. This is just for my own understanding of how to allocate secure memory, using crypto-algorithms etc.
For…

KillPinguin
- 390
- 4
- 15
2
votes
0 answers
AES128 encrypt/decrypt using gcrypt in c++
i couldnt find a working good example so ive created one
you can change mykey ,and make the iv random using one of the gcrypt function.
sample
#include
#include
typedef unsigned char byte;
using namespace std;
#define BLOCK…

e.z.a
- 71
- 5
2
votes
1 answer
Error using gcrypt on function gcry_cipher_encrypt C++
I'm trying to use gcrypt to make a simple cryptography a txt file. When I executes the command gcry_cipher_encrypt i receive the follow errors:
gcry_strsource => User defined source 1
gcry_strerror => Invalid length
This occurs when I use the…

Juliano Oliveira
- 868
- 1
- 9
- 29
2
votes
5 answers
Strip AES padding during fread/fwrite
I'm using libgcrypt to encrypt and decrypt files. When I take in the proper amount of bytes using fread, I need to pad it with 16-n bytes in order for it to properly be encrypted by gcry_cipher_encrypt. Upon decryption however, the null…

Chirality
- 745
- 8
- 22