Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

Problem with padding and lost of data

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


contato at tiago

Jul 19, 2012, 4:59 PM

Post #1 of 2 (204 views)
Permalink
Problem with padding and lost of data

I am having two problems when I use libgcrypt:

1) When I use padding, it is not removed during the decryption. And I am
adding the "(flags pkcs1)" to S-expression before decrypt.

2) If I do not use padding and I encrypt and decrypt a block of bytes
which starts with the byte zero, I lose that first byte after decryption.

I attached a program that I am using to test libgcrypt.

Does anyone can help me?


--


Tiago de França Queiroz

Universidade Federal do ABC - UFABC
Bacharelando em Ciências e Tecnologia
Bacharelando em Ciências da Computação
Attachments: post.c (3.81 KB)


wk at gnupg

Jul 22, 2012, 9:19 AM

Post #2 of 2 (184 views)
Permalink
Re: Problem with padding and lost of data [In reply to]

On Fri, 20 Jul 2012 01:59, contato [at] tiago said:

> 1) When I use padding, it is not removed during the decryption. And I am
> adding the "(flags pkcs1)" to S-expression before decrypt.

IIRC, the decryption feature has only been available since 1.5.0. Do
you use this version? Older version allow to pass the flag but dod not
implement decryption.

> 2) If I do not use padding and I encrypt and decrypt a block of bytes
> which starts with the byte zero, I lose that first byte after decryption.

Never ever use RSA without padding. Thus this is not relevant.

The zero is missing because the raw data is treated as a number and
leading zeroes are removed.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.