Pretty Good Privacy (PGP)
Pretty Good Privacy (PGP) allows you to send files and messages securely over the Internet. PGP generates a public key (to encrypt messages) and a private key (to decrypt messages).
PGP in MuleSoft – Mule can encrypt all or part of a message using Pretty Good Privacy (PGP). PGP combines data compression and data encryption to secure messages. The compression reduces the size of the payload to help reduce the transmission time later on your application. Due to its increased complexity, PGP encryption is a heavy-load task when compared to JCE or XML encryption.
Mostly we can have two scenarios w.r.t to PGP usage
- Generate Private Public PGP key – We generate Private/Public key and use it for our own data/files security, we have a public key (to lock/encrypt the message) and a private key (to unlock/decrypt the message). We would give our Public key to different vendor/client so that they can send us the encrypted sensitive data/files. Once we receive an encrypted message, we use our private key to decrypt it.
- Vendor Provided PGP Public Key – We can use someone Public key to do encryption and send them the encrypted data/files. Once they receive it then they can use their Private key to decrypt
To make life simple we can use the tool Kleopatra for managing PGP keys, there are other ways to manage PGP keys like GIT bash which provide command line interface due to which they are somewhat complex to use.
Download Kleopatra
- Windows from – https://www.gpg4win.org/download.html
- Linux – https://kde.org/applications/en/utilities/org.kde.kleopatra
More info on the tool – https://www.openpgp.org/software/kleopatra/
Steps to install – double click and run the installer, click next
Select only Kleopatra and click next
Select the folder
Once installation complete, click next
Check the Run Kleopatra and Click Finish
This will open the Kleopatra on you system
We can see two option
- New Key Pair – this is for scenario first where we have to create both Private/Public key
- Import – this is for second scenario where we have to only use Public key for PGP encryption
With this you will be able to manage your PGP keys