aspose file tools*
The moose likes Java in General and the fly likes Encrypt a zip file using PGP in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Encrypt a zip file using PGP in java" Watch "Encrypt a zip file using PGP in java" New topic
Author

Encrypt a zip file using PGP in java

sarada bokka
Ranch Hand

Joined: Jan 13, 2010
Posts: 80
Hi All,

I tried doing PGP encryption for a file using "PGP Encryption using Bouncy Castle" (http://cephas.net/blog/2004/04/01/pgp-encryption-using-bouncy-castle/) and it is working fine.

I would like to have the same kind of PGP encrypting for a zip file using java.

Could some one throw your thought's in achieving this.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
Why do you think encrypting a ZIP file would be different than encrypting any other kind of file?


Ping & DNS - my free Android networking tools app
sarada bokka
Ranch Hand

Joined: Jan 13, 2010
Posts: 80
I tried to encrypt the xip file as normal file

But after decrypting I am unable to unzip the file and throws "cannot open decrypttest.zip file as archive"

Encryption source

Decryption source


jar file required : bcprov-jdk15-147b01.jar,bcpg-jdk15-1.44.jar

Please advice me how to proceed?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
ZIP files are binary data - you can't use Readers and Writers to work with them; you need to use Streams.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Encrypt a zip file using PGP in java