Implementing PGP (Pretty Good Privacy) using Bouncy Castle Crypto APIs
I was just exploring the Java API's for encrypting and decrypting the file using PGP (Pretty Good Privacy), and I came across Bouncy Castle Crypto APIs. Here we will simply see how to use the Bouncy Castle APIs. Firstly download the cypto jar from the bouncy castle site, you can find the links in the end. 1. Extract the Jar “crypto-145” at 2. The java classes are at location “.crypto-145\src\org\bouncycastle\openpgp\examples” Use the jar’s at “crypto-145\jars” as per your SDK:- I have used bcpg-jdk16-145.jar and bcprov-jdk16-145.jar You need to first compile the JAVA classes. Lets create the public and private key:- 1. We will use RSAKeyPairGenerator.java java class to generate the key’s java org . bouncycastle . openpgp . examples . RSAKeyPairGenerator charlie "open sesame" ---where -- Ch...