Monday, October 26, 2009

How to use GPG/GnuPG

This guide will show you how to use and setup GPG for file encryption. GPG is an encryption and signing tool for the Linux/Unix operating system. GPG is the main program for the GnuPG system.

Getting Started
To start you need to First run the generation commands:
Code:
# gpg --gen-key

gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Use the default (1) and press enter.

Code:
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Use the default here, press enter.

Code:
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Again use the default.

Code:
Key does not expire at all
Is this correct? (y/N)
Enter "y" and press enter.

Code:
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) "

Real name:
Type in a name to identify the key. I use my first name for this example I will use "tor". Remember the name you use (used later).

Then enter your email address and comment.

Code:
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
Press O and then Enter.

Code:
Enter passphrase:
Type a unique passphrase. This is like a password.

Code:
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
++++++++++++++++++++++++++++++.+++++.+++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++.++++++++++.>+++++.................................................................>+++++.<+++++.......................................>+++++.....+++++

Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 277 more bytes)
Type some buttons or open another terminal. Now you have a key generated with your first name and should not get that error above.

Enjoy ubuntu... ;)

No comments:

kunkun-laptop .... ;)