Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help on genarate public key,private key to test PGP encryption & decryption on windows system

 
ChakraPani Margani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have some java code to encrypt a file using some public key. I have public key file. File encrypted successfully. Now I want to decrypt the encrypted file to get the original file. For that one I need private key & password. I don't have private key & password. I am using PGP encryption algorithim. Please guide me how to genarate public key file & private key file & password. So that I can test the code with one file encryption & decryption in my side. I am spending lot of time on the net. Bit difficult for me to understand all those.

Please help me on this.


Thanks in advance.


Regards,
ChakraPani.
 
David A Morris
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You indicated you have a public key.
Is this your own key or is this someone elses who you intend to send the encrypted file to?

I assume it must be someone elses because if it was your own key you should already know the password and be able to generate the private key for it using PGP desktop or numerous free utilities to generate key pairs.

If my assumption is right, the easiest way to test your routine is to encrypt the file to TWO public keys. The public key of the person you intend to send the file to as well as your own public key. This way, you will both be able to decrypt the file.

You are probably already using encryptedDataGenerator.addMethod(PGPPublicKey) to add the public key you have.

Just do this a second time with your own key as well.

Then the file will be encrypted to both keys allowing both people to decrypt it.

 
ChakraPani Margani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic