<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vincentkong.com &#187; PGP</title>
	<atom:link href="http://www.vincentkong.com/tag/pgp/feed" rel="self" type="application/rss+xml" />
	<link>https://www.vincentkong.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Jul 2010 00:32:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>GnuPGP Quickstart Guide</title>
		<link>https://www.vincentkong.com/2010/01/gnupgp-quickstart-guide</link>
		<comments>https://www.vincentkong.com/2010/01/gnupgp-quickstart-guide#comments</comments>
		<pubDate>Fri, 08 Jan 2010 17:00:00 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[PGP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.vincentkong.com/?p=1172</guid>
		<description><![CDATA[&#8220;GnuPG uses public-key cryptography so that users can communicate securely. In a public-key system, each user has a pair of keys consisting of a private and public key. A user&#8217;s private key is kept secret; it need never to be revealed. The public-key maybe given to anyone with whom the user wants to communicate.&#8221; &#8211; [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2008/01/samba-on-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Samba on Ubuntu Quickstart Guide'>Samba on Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/05/mysql-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: MySQL for Ubuntu Quickstart Guide'>MySQL for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2008/05/wordpress-quickstart-guide' rel='bookmark' title='Permanent Link: WordPress Quickstart Guide'>WordPress Quickstart Guide</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>&#8220;<a href="http://www.gnupg.org">GnuPG</a> uses public-key cryptography so that users can communicate securely. In a public-key system, each user has a pair of keys consisting of a private and public key.  A user&#8217;s private key is kept secret; it need never to be revealed.  The public-key maybe given to anyone with whom the user wants to communicate.&#8221; &#8211; <a href="http://www.gnupg.org/gph/en/manual.html">The GNU Privacy Handbook</a></p>
<p>GnuPGP or GPG (Gnu Privacy Guard) is a computer program that implements the OpenGPG standard; an open source alternative to the PGP commercial product.</p>
<p>The core package for GnuPGP <code>gnupg</code> is installed by default on Ubuntu.   This quick start guide will discuss about performing file encryption with GPG.</p>
<h3>Generating a Key</h3>
<p>Type the following command:</p>
<p><code>$ gpg --gen-key</code></p>
<p>After executing the command you will be prompt with the following:</p>
<pre>Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)</pre>
<p>Enter option <code>1</code> to allow encryption and decryption.</p>
<pre>What keysize do you want? (2048)</pre>
<p>Enter <code>2048</code> which is the default recommended by GnuPGP</p>
<pre>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</pre>
<p>Enter <code>0</code> so that there is no expiration date for the key.</p>
<p>Next you will need to enter your user information.</p>
<pre>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) "</pre>
<p>Enter your &#8220;Real name&#8221;, &#8220;Email address&#8221;, and &#8220;Comment&#8221; is optional.</p>
<pre>Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?</pre>
<p>Confirm your information by entering <code>O</code>, and the key generation will begin.</p>
<pre>Enter passphrase:</pre>
<p>Next you will need to enter a passphrase; remember that if you forget your passphase then your key will be useless.</p>
<pre>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.
+++++.++++++++++.++++++++++.+++++++++++++++++++++++++.+++++++++++++++.+++++++++++++++...+++++.+++++++++++++++++++++++++++++++++++++++++++++&gt;++++++++++&gt;.+++++............................................................................+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 283 more bytes)</pre>
<p>During the key generation follow the instruction mentioned above and wait patiently for your key to complete generating.</p>
<p>When the key has completed generating the following summary will be prompted:</p>
<pre>gpg: key <strong>2DFD492E</strong> marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   1024D/<strong>2DFD492E</strong> 2009-10-14
Key fingerprint = FCAC 0686 401B A333 546E  F081 0459 61E9 2DED 490C
uid                  Vincent Kong &lt;vkong@myemail.com&gt;
sub   2048g/457534BF 2009-10-14</pre>
<p>The new generated key ID is <strong><code>2DFD492E</code></strong></p>
<h3>Listing the keys</h3>
<p><code>$ gpg --list-keys</code></p>
<h3>Importing a Public Key</h3>
<p><code>$ gpg --import KEYFILE</code></p>
<h3>Encrypting a File</h3>
<p>To encrypt a file for another user, the encryption must be done with <strong>their public key</strong>, which needs to be imported first.</p>
<p><code>$ gpg --output ENCRYPTED_FILE.gpg --encrypt --recipient USER_PUBLIC_KEY_ID ORIGINAL_FILE</code></p>
<h3>Decrypting a File</h3>
<p>If a user sent you a file that has been encrypted with <strong>your</strong> public key, it can be decrypted with the following:</p>
<p><code>$ gpg --decrypt ENCRYPTED_FILE.gpg</code></p>
<h3>Exporting Your Public Key</h3>
<p><code>$ gpg --armor --export KEY_ID</code></p>
<h3>Signing a Public Key</h3>
<p>In GnuPG, if you get an error saying <code>There is no assurance this key belongs to the named user</code> when trying to encrypt, you need to sign the public key.</p>
<p><code>$ gpg --sign-key PUBLIC_KEY_ID</code></p>
<h3>Edit a Key</h3>
<p><code>$ gpg --edit-key KEY_ID</code></p>
<p>Information associated to <code>KEY_ID</code> will be displayed followed by the <code>Command&gt;</code> prompt; type <code>help</code> to display the list of command which can be used to modify the key</p>
<p>A detailed how-to guide about GnuPGP can be found <a href="https://help.ubuntu.com/community/GnuPrivacyGuardHowto">here</a>.</p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2008/01/samba-on-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Samba on Ubuntu Quickstart Guide'>Samba on Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/05/mysql-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: MySQL for Ubuntu Quickstart Guide'>MySQL for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2008/05/wordpress-quickstart-guide' rel='bookmark' title='Permanent Link: WordPress Quickstart Guide'>WordPress Quickstart Guide</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2010/01/gnupgp-quickstart-guide/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
