Two Laptop Bag*
The moose likes Security and the fly likes PGP encryption / decryption and Bouncycastle. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "PGP encryption / decryption and Bouncycastle." Watch "PGP encryption / decryption and Bouncycastle." New topic
Author

PGP encryption / decryption and Bouncycastle.

Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Where to start for Encryption/Decryption of files?

I am using PGP and thinking of using Bouncycastle jar to do a job.

-- Can anyone summarize what all are neccessary for encrypting and decrypting a Single File with bouncycastle or whatever technology you suggest?

-- Is digital signature and Encryption the same thing? for example if it means the file is encrypted does it mean the file is digitally signed or the file can be both digitally signed and then encrypted ?


Time is what we want the most, but what we use the worst. -- William Penn
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
A digital signature is not the same thing as encryption. I don't know of a way to summarize what you need in a post. One book that some folks recommend is Beginning Cryptography With Java by David Hook. The author is also the bouncycastle guy, so that book might be a good start. Another library you might look into is jasypt.


Nice to meet you.
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

To be precise All I want is -

- create my own Key pairs
- add them to a my key ring
- encrypt a file with my priv key from the priv key ring.
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Nevermind, all done achieved

I fought alone for all of them.
Gupta Singh
Greenhorn

Joined: Feb 25, 2009
Posts: 5
To pick up where this leaves off, I am stuck trying to implement a solution for our ERP system where I can store the PGP block of encoded key material in the DB, retrieve said key text, create a key from the text and use that key to encrypt data. The problem I am facing is that we won't be using a Key Ring file on the server and only want to work from the encoded key text.

I can not find any way to create a PGPPublicKey from the encoded key text. Can someone help me connect the dots? I've read Beginning Crypto and have worked with the BC examples, but everything I find always uses a Key ring file. There's got to be a way to do it, I just don't see it.

Thanks in advance for your help.

GS
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PGP encryption / decryption and Bouncycastle.