1 GnuPG - The GNU Privacy Guard
2 -------------------------------
5 GnuPG is now in Beta test and you should report all bugs to the
6 mailing list (see below). The 0.9.x versions are mainly released
7 to fix all remaining serious bugs. As soon as version 1.0 is out,
8 development will continue with a 1.1 series and bug fixes for the
9 1.0 version are released as needed.
11 GnuPG works best on GNU/Linux or *BSD. Other Unices are
12 also supported but not as good tested as those Freenix ones.
13 Please verify the tar file; there is a PGP2 and a GnuPG/PGP5
14 signature available. My PGP2 key is well known and published in
15 the "Global Trust Register for 1998", ISBN 0-9532397-0-5.
17 I have included my pubring as "g10/pubring.asc", which contains
18 the key used to make GnuPG signatures:
19 "pub 1024D/57548DCD 1998-07-07 Werner Koch (gnupg sig) <dd9jn@gnu.org>"
20 "Key fingerprint = 6BD9 050F D8FC 941B 4341 2DCC 68B7 AB89 5754 8DCD"
23 "pub 1024D/621CC013 1998-07-07 Werner Koch <werner.koch@guug.de>"
24 "Key fingerprint = ECAF 7590 EB34 43B5 C7CF 3ACB 6C7E E1B8 621C C013"
26 You may want add it to your GnuPG pubring and use it in the future to
27 verify new releases. Because you verified this README file and
28 _checked_that_it_is_really_my PGP2 key 0C9857A5, you can be sure
29 that the above fingerprints are correct.
31 Please subscribe to g10@net.lut.ac.uk by sending a mail with
32 the word "subscribe" in the body to "g10-request@net.lut.ac.uk".
33 This mailing list is a closed one (only subscribers are allowed
34 to post) to avoid misuse by folks who don't know the Netiquette
35 and trash you mailspool with commercial junk.
37 See the file COPYING for copyright and warranty information.
39 GnuPG is in compliance with RFC2440 (OpenPGP), see doc/OpenPGP for
42 Due to the fact that GnuPG does not use use any patented algorithm,
43 it cannot be compatible with PGP2 versions; PGP 2.x does only use
44 IDEA (which is patented worldwide) and RSA (which is patented in
45 the United States until Sep 20, 2000).
47 The default algorithms are now DSA and ElGamal. ElGamal for signing
48 is still available, but due to the larger size of such signatures it
49 is depreciated (Please note that the GnuPG implementation of ElGamal
50 signatures is *not* insecure). Symmetric algorithms are: 3DES,
51 Blowfish and CAST5 (Twofish will come soon), available digest
52 algorithms are MD5, RIPEMD160, SHA1 and TIGER/192.
58 Please read the file INSTALL!
60 Here is a quick summary:
68 4) You end up with the binaries "gpg" and "gpgm" in /usr/local/bin.
70 5) Optional, but suggested: install the binary "gpg" as suid root.
76 This is a brief overview how to use GnuPG - it is highly suggested
77 that you read the manual^H^H^H more information about the use
78 of cryptography. GnuPG is only the technical tool to do it and
79 the security highly depends on that YOU KNOW WHAT YOU ARE DOING.
81 If you already have a DSA key from PGP 5 (they call them DH/ElGamal)
82 you can simply copy the pgp keyrings over the GnuPG keyrings after
83 running gpg once, so that it can create the correct directory.
85 The normal way to create a key is:
89 This asks some questions and then starts key generation. To create
90 good random numbers for the key parameters, GnuPG needs to gather
91 enough noise (entropy) from your system. If you see no progress
92 during key generation you should start some other activities such
93 as mouse moves or hitting on the CTRL and SHIFT keys.
95 Generate a key ONLY on a machine where you have direct physical
96 access - don't do it over the network or on a machine used also
97 by others - especially if you have no access to the root account.
99 When you are asked for a passphrase; use a good one which you can easy
100 remember. Don't make the passphrase too long because you have to
101 type it for every decryption or signing; but - AND THIS IS VERY
102 IMPORTANT - use a good one which is not easily guessable as the
103 security of the whole system relies on your secret key and the
104 passphrase is used to protect this secret key in case someone was
105 able to get access to your secret keyring. A good way to select
106 a passphrase is to figure out a short nonsense sentence which makes
107 some sense for you and modify it by inserting extra spaces, non-letters
108 and changing the case of some characters - this is really easy to
109 remember especially if you associate some pictures with it.
111 Then you should create a revocation certificate in case someone
112 gets knowledge of your secret key or you forgot your passphrase:
114 gpg --gen-revoke your_user_id
116 Run this command and store it away; output is always ASCII armored,
117 so that you can print it and (hopefully never) re-create it if
118 your electronic media fails.
120 Now you can use your key to create digital signatures:
124 This creates a file file.gpg which is compressed and has a signature
129 Same as above, but creates the file.asc which is ascii armored and
130 and ready for sending by mail. Note: It is better to use your
131 mailers features to create signatures (The mailer uses GnuPG to do
132 this) because the mailer has the ability to MIME encode such
133 signatures - but this is not a security issue.
137 Creates a signature of file, but writes the output to the file "out".
139 Everyone who knows your public key (you can and should publish
140 your key by putting it on a key server, a web page or in your .plan
141 file) is now able to check whether you really signed this text;
145 GnuPG now checks whether the signature is valid and prints an
146 appropriate message. If the signature is good, you know at least
147 that the person (or machine) has access to the secret key which
148 corresponds to the published public key.
149 If you run gpg without an option it will verify the signature and
150 create a new file which is identical to the original file. gpg
151 can also run as a filter, so that you can pipe data to verify
154 cat signed-file | gpg | wc -l
156 will check the signature of signed-file and then display the
157 number of lines in the original file.
159 To send a message encrypted to someone you can use this:
163 This encrypts file with the public key of the user "heine" and
164 writes it to "file.gpg"
166 echo "hallo" | gpg -ea -r heine | mail heine
168 Ditto, but encrypts "hallo\n" and mails it as ascii armored message
169 to the user with the mail address heine.
171 gpg -se -r heine file
173 This encrypts file with the public key of "heine" and writes it
174 to "file.gpg" after signing it with your user id.
176 gpg -se -r heine -u Suttner file
178 Ditto, but sign the file with your alternative user id "Suttner"
181 GnuPG has some options to help you publish public keys; this is
182 called "exporting" a key:
184 gpg --export >all-my-keys
186 exports all the keys in the keyring and writes them (in a binary format)
187 to all-my-keys. You may then mail "all-my-keys" as an MIME attachment
188 to someone else or put it on an FTP server. To export only some
189 user IDs, you give them as arguments on the command line.
191 To mail a public key or put it on a web page you have to create
192 the key in ASCII armored format:
194 gpg --export --armor | mail panther@tiger.int
196 This will send all your public keys to your friend panther.
198 If you have received a key from someone else you can put it
199 into your public keyring; is called "importing":
201 gpg --import [filenames]
203 New keys are appended to your keyring and already existing
204 keys are updated. Note that GnuPG does not allow keys which
205 are not self-signed by the user.
207 Because anyone can claim that the public key belongs to her
208 we must have some way to check that the public key really belongs
209 to the owner. This can be achieved by comparing the key during
210 a phone call. Sure, it is not very easy to compare a binary file
211 by reading the complete hex dump of the file - GnuPG (and nearly
212 every other program used for management of cryptographic keys)
213 provides other solutions:
215 gpg --fingerprint <username>
217 prints the so called "fingerprint" of the given username; this
218 is a sequence of hex bytes (which you may have noticed in mail
219 sigs or on business cards) which uniquely identify the public
220 key - two different keys will always have different fingerprints.
221 It is easy to compare this fingerprint by phone and I suggest
222 that you print your fingerprint on the back of your business
225 If you don't know the owner of the public key you are in trouble;
226 but wait: A friend of you knows someone who knows someone who
227 has met the owner of the public key at some computer conference.
228 So all the persons between you and the public key holder may now
229 act as introducer to you; this is done by signing the keys and
230 thereby certifying the other keys. If you then trust all the
231 introducers to correctly sign other keys, you can be be sure that
232 the other key really belongs to the one who claims so.
234 There are 2 steps to validate a target key:
235 1. First check that there is a complete chain
236 of signed keys from the public key you want to use
237 and your key and verify each signature.
238 2. Make sure that you have full trust in the certificates
239 of all the introduces between the public key holder and
241 Step 2 is the more complicated part because there is no easy way
242 for a computer to decide who is trustworthy and who is not. GnuPG
243 leaves this decision to you and will ask you for a trust value
244 (here also referenced as the owner-trust of a key) for every key
245 needed to check the chain of certificates. You may choose from:
246 a) "I don't know" - then it is not possible to use any
247 of the chains of certificates, in which this key is used
248 as an introducer, to validate the target key. Use this if
249 you don't know the introducer.
250 b) "I do not trust" - Use this if you know that the introducer
251 does not do a good job in certifying other keys. The effect
252 is the same as with a) but for a) you may later want to
253 change the value because you got new information about this
255 c) "I trust marginally" - Use this if you assume that the
256 introducer knows what he is doing. Together with some
257 other marginally trusted keys, GnuPG validates the target
259 d) "I fully trust" - Use this if you really know that this
260 introducer does a good job when certifying other keys.
261 If all the introducer are of this trust value, GnuPG
262 normally needs only one chain of signatures to validate
263 a target key okay. (But this may be adjusted with the help
265 These information are confidential because they give your
266 personal opinion on the trustworthy of someone else. Therefore
267 this data is not stored in the keyring but in the "trustdb"
268 (~/.gnupg/trustdb.gpg). Do not assign a high trust value just
269 because the introducer is a friend of you - decide how far she
270 understands all the implications of key signatures and you may
271 want to tell him more about public key cryptography so you
272 can later change the trust value you assigned.
274 Okay, here is how GnuPG helps you in key management: Most stuff is
275 done with the --edit-key command:
277 gpg --edit-key <keyid or username>
279 GnuPG displays some information about the key and then prompts
280 for a command (enter "help" to see a list of commands and see
281 the man page for a more detailed explanation). To sign a key
282 you select the user ID you want to sign by entering the number
283 which is displayed in the leftmost column (or do nothing if the
284 key has only one user ID) and then enter the command "sign" and
285 follow all the prompts. When you are ready, give the command
286 "save" (or use "quit" to cancel your actions).
288 If you want to sign the key with another user ID of yours, you
289 must give an "-u" option on the command line together with the
292 Normally you want to sign only one user ID because GnuPG
293 does only use one and this keeps the public key certificate
294 small. Because such key signatures are very important you
295 should make sure that the signators of your key sign a user ID
296 which is very likely to stay for a long time - choose one with an
297 email address you have full control of or do not enter an email
298 address at all. In future GnuPG will have a way to tell which
299 user ID is the one with an email address you prefer - because
300 you have no signatures on this email address it is easy to change
301 this address. Remember: Your signators sign your public key (the
302 primary one) together with one od your user IDs - so it is not possible
303 to change the user ID later without voiding all the signatures.
305 Tip: If you hear about a key signing party on a computer conference
306 join it because this is a very convenient way to get your key
307 certified (But remember that signatures have nothing to to with the
308 trust you assign to a key).
311 7 Ways to Specify a User ID
312 --------------------------
313 There are several ways to specify a user ID, here are some examples:
315 * Only by the short keyid (prepend a zero if it begins with A..F):
322 * By a complete keyid:
331 "1234343434343434C434343434343434"
332 "123434343434343C3434343434343734349A3434"
333 "0E12343434343434343434EAB3484343434343434"
335 The first one is MD5 the others are ripemd160 or sha1.
337 * By an exact string:
339 "=Heinrich Heine <heinrichh@uni-duesseldorf.de>"
341 * By an email address:
343 "<heinrichh@uni-duesseldorf.de>"
345 * By the Local ID (from the trust DB):
349 This may be used by a MUA to specify an exact key after selecting
350 a key from GnuPG (by the use of a special option or an extra utility)
352 * Or by the usual substring:
357 The '*' indicates substring search explicitly.
362 If you use the option "--batch", GnuPG runs in non-interactive mode and
363 never prompts for input data. This does not even allow entering the
364 passphrase; until we have a better solution (something like ssh-agent),
365 you can use the option "--passphrase-fd n", which works like PGPs
368 Batch mode also causes GnuPG to terminate as soon as a BAD signature is
374 GnuPG returns with an exit status of 1 if in batch mode and a bad signature
375 has been detected or 2 or higher for all other errors. You should parse
376 stderr or better the output of the fd specified with --status-fd to get
377 detailed information about the errors.
383 gpg --list-packets datafile
385 Use this to list the contents of a data file. If the file is encrypted
386 you are asked for the passphrase, so that GnuPG is able to look at the
387 inner structure of a encrypted packet. This command should be able
388 to list all kinds of rfc2440 messages.
392 List the contents of the trust DB in a human readable format
394 gpgm --list-trustdb <usernames>
396 List the tree of certificates for the given usernames
398 gpgm --list-trust-path username
400 List the possible trust paths for the given username. The length
401 of such a trust path is limited by the option --max-cert-depth
404 For more options/commands see the man page or use "gpg --help".
410 The primary FTP site is "ftp://ftp.gnupg.org/pub/gcrypt/"
411 The primary WWW page is "http://www.gnupg.org"
413 See http://www.gnugp.org/mirrors.html for a list of FTP mirrors
414 and use them if possible.
416 Please direct bug reports to <gnupg-bugs@gnu.org> or better
417 post them to the mailing list <g10@net.lut.ac.uk> (this is a
418 closed list - subscribe before posting, see above (~line 33)).
419 Please direct questions about GnuPG to the mailing list or
420 one of the pgp newsgroups; this gives me more time to improve
421 GnuPG. Commercial support for GnuPG will be availabe soon.
423 Have fun and remember: Echelon is looking at you kid.