PGP (Pretty Good Privacy) Encryption is a widely used encryption mechanism which can be used to provide public key encryption.
There are many PGP encryption implementations using Java language which are quite complex. But Apache Camel Crypto component facilitates a very simple and convenient way of implementing PGP encryption.
Following code encrypts a given message using Apache Camel. org.apache.camel:camel-crypto is the only one library i have used here.
Most of the example in the internet shows the way which a file is used as the input for the encryption. But here i will show you how to directly encrypt a string (text message).
I'm using the public key in the public.gpg file to encrypt the message. The code is really straight foreword. Complete working project is available on GitHub and the URL is available at the bottom. All required key files are available there. You can clone the project and execute the program.
Following is the GitHub URL of complete project of this tutorial.
https://github.com/lakjcomspace/PGPEncryption
There are many PGP encryption implementations using Java language which are quite complex. But Apache Camel Crypto component facilitates a very simple and convenient way of implementing PGP encryption.
Following code encrypts a given message using Apache Camel. org.apache.camel:camel-crypto is the only one library i have used here.
Most of the example in the internet shows the way which a file is used as the input for the encryption. But here i will show you how to directly encrypt a string (text message).
I'm using the public key in the public.gpg file to encrypt the message. The code is really straight foreword. Complete working project is available on GitHub and the URL is available at the bottom. All required key files are available there. You can clone the project and execute the program.
Following is the GitHub URL of complete project of this tutorial.
https://github.com/lakjcomspace/PGPEncryption
I go to see everyday some sites and information sites to read articles or reviews, but this website gives feature based writing.
ReplyDeleteAttractive section of content. I just stumbled upon your site and
ReplyDeletein accession capital to assert that I acquire actually enjoyed account your blog posts.
Anyway I will be subscribing to your feeds and
even I achievement you access consistently fast.