How to use GnuPG (GPG)?

By: Darrell Brogdon Emailed: 1674 times Printed: 2154 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

GnuPG is strictly a command-line utility. There are several GUI wrappers to GPG but the binary is usually required. Since its core purpose is to encrypt and decrypt information, we're first going to have a look at doing just that, using GPG.

As with most Unix-based command-line utilities you first call the gpg command followed by switches that affect the output of the utility. For example, to encrypt a file called "my_secret_data.txt" you would call GnuPG with the -ecommand to encrypt followed by the -r NAME to tell GnuPG who should be able to decrypt the file. "NAME" in this instance is the first name or email address of the person who will be receiving the encrypted file. (Note that the user indicated by NAME must be in your public key ring and can be obtained by typing gpg –list-keys). 

Here it is in action:

gpg --r john@doe.com my_secret_file.txt

Once this is done you will a file called 'my_secret_file.txt.gpg' in your current directory. Any attempts to view the contents of this file will prove futile unless you encrypted it using your own Public Key. Feeling like a secret agent yet?

Now suppose Mr. John Doe has encrypted a file and sent it to you. To decrypt it you simply use the -d switch followed by the encrypted file.

gpg -d john_doe_secret_file.txt.gpg

Since you have your private key contained within your secret key ring GnuPG can determine whom 'john_doe_secret_file.txt.gpg' was intended for and will decrypt it after you provide your passphrase.


Trends Home | All Trends Tutorials | Latest Trends Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Darrell Brogdon
Decrypting files using GnuPG (GPG) via PHP
Encrypting files using GnuPG (GPG) via PHP
How to use GnuPG (GPG)?
What is PGP?

More Tutorials in Trends
What is Hadoop?
Internet of Things
Browser Based Communications - WebRTC
Big Data - An Introduction
Will Apple open retail showrooms in India?
A comparison of VMware, Microsoft Hyper-V and Xen.
What is a chromebook?
Review: Ruggear - The world's most Rugged Phone in Singapore
What is Google Dart?
DKVM-8E Console Password (DLink KVM Switch)
What is Microsoft Office 365?
Migration from IPV4 to IPV6
What is PGP?
How to use GnuPG (GPG)?
The Failure of 2FA / Two-Factor Authentication

More Latest News
Most Viewed Articles (in Trends )
What is SaaS?
What is Hadoop?
DKVM-8E Console Password (DLink KVM Switch)
What is Google Dart?
What is cloud computing?
What is Groovy? Getting Started with Groovy - A tutorial
How to use GnuPG (GPG)?
What is Microsoft Office 365?
Introduction to Amazon Web Services
What is Google Apps?
Communications-as-a-Service Solutions
Google's Strategic Threat to Carrier Margins for New Services
Android Basics - An Introduction to Android
Google Wave - Get Ready for the next big wave from Google
Internet of Things
Most Emailed Articles (in Trends)
What is SaaS?
What is Hadoop?
What is cloud computing?
Google Wave - Get Ready for the next big wave from Google
Android Basics - An Introduction to Android
Internet of Things
What is Groovy? Getting Started with Groovy - A tutorial
A comparison of VMware, Microsoft Hyper-V and Xen.
What is Google Dart?
Google's Strategic Threat to Carrier Margins for New Services
What is cloud computing?
Different Types of cloud
What cloud service providers typically offer?
What is Windows Azure?
What is IAAS?