Problem in case decrypting large file size

Peter Pentchev roam at
Mon Jun 30 12:56:48 CEST 2008

On Sun, Jun 29, 2008 at 04:42:00PM +0530, ajay Madamala wrote:
> Hello all
> Currently we are working on GPG implementation in project with Java
> integration.GPG commands will be called by Java code at runtime. However, we
> were not able to test decryption via java code if source file was >2kb
> size..Please advice me how to overcome this case...Inputs are more
> helpful...

Assuming you meant two *giga*bytes, not two kilobytes, I think
the most common work-around is to pass the encrypted data on
gpg's standard input and read the decrypted data from its standard
output.  That is, instead of doing something like:

  gpg -d file.txt.enc

and expecting to get a file.txt after a successful decryption, do this:

  gpg -d < file.txt.enc > file.txt

Of course, the exact invocation depends on your programming language,
libraries and stuff (you may invoke a shell and pass it this command
with the redirections, or you may fork off a process and reopen its
file descripts 0 and 1, or...), but that's the general idea.

Hope that helps.


Peter Pentchev	roam at    roam at    roam at
PGP key:
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This sentence claims to be an Epimenides paradox, but it is lying.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: </pipermail/attachments/20080630/bde5a4ba/attachment.pgp>

More information about the Gnupg-users mailing list