GnuPG is an implementation of the OpenPGP standard (also known as PGP). For more information and documentation, see the GnuPG site.
By default, this utility is available in almost all of the Linux/Unix operating systems.
To verify if the GPG utility is installed, run the command which gpg. In general, you should find it in /usr/bin/.
To create a GPG key, run the following command:
At the prompt, specify the kind of key you want, or press Enter to accept the default RSA and RSA.
Enter the desired key size. Talend recommends the maximum key size of 4096.
Enter the length of time the key should be valid. Press Enter to specify the default selection, indicating that the key doesn't expire (0).
Enter the Real name (enter any name, at least 5 characters are required).
Provide the email id (any vaild email id can be provided).
Verify that your selections are correct.
Type the letter O for Okay.
Provide a passphrase. Using at least eight characters is recommended as a best practice.
You will be prompted to type the passphrase again.
Verify that the key was generated successfully by running the following command:
Now that you have created the key, you can encrypt any file by following these steps.
Encrypt the file using the following syntax:
gpg --batch --yes --recipient user-id --output Absolute path/XXX.pgp –encrypt Absolute path/xxxxxx.txt
For example, this command will create a file named test.pgp:
gpg --batch --yes --recipient email@example.com --output /root/Talend6.3.1/test.pgp --encrypt /root/Talend6.3.1/test.txt
You can verify the file running the command:
gpg -d Absolute path/test.pgp
You will be prompted to provide the passphrase you used while creating the GPG key: