~ubuntu-branches/ubuntu/jaunty/gnupg2/jaunty

« back to all changes in this revision

Viewing changes to doc/gph/c3.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<chapter id="management" xreflabel="3">
 
2
<docinfo>
 
3
<date>
 
4
$Id$
 
5
</date>
 
6
</docinfo>
 
7
<title>
 
8
Key Management
 
9
</title>
 
10
 
 
11
<para>
 
12
Key tampering is a major security weakness with public-key cryptography.
 
13
An eavesdropper may tamper with a user's keyrings or forge a
 
14
user's public key and post it for others to download and use.
 
15
For example, suppose Chloe wants to monitor the messages that Alice
 
16
sends to Blake.
 
17
She could mount what is called a <firstterm>man in the 
 
18
middle</firstterm> attack.
 
19
In this attack, Chloe creates a new public/private keypair.
 
20
She replaces Alice's copy of Blake's public key with the new public key.
 
21
She then intercepts the messages that Alice sends to Blake.
 
22
For each intercept, she decrypts it using the new private key, reencrypts
 
23
it using Blake's true public key, and forwards the reencrypted
 
24
message to Blake.
 
25
All messages sent from Alice to Blake can now be read by Chloe.
 
26
</para>
 
27
 
 
28
<para>
 
29
Good key management is crucial in order to ensure not just the integrity
 
30
of your keyrings but the integrity of other users' keyrings as well.
 
31
The core of key management in &gnupg; is the notion of signing keys.
 
32
Key signing has two main purposes: it permits you to detect tampering
 
33
on your keyring, and it allows you to certify that a key truly belongs
 
34
to the person named by a user ID on the key.
 
35
Key signatures are also used in a scheme known as the <firstterm>web of 
 
36
trust</firstterm> to extend certification to keys not directly signed by you 
 
37
but signed by others you trust.
 
38
Responsible users who practice good key management can defeat key
 
39
tampering as a practical attack on secure communication with &gnupg;.
 
40
</para>
 
41
 
 
42
<sect1>
 
43
<title>
 
44
Managing your own keypair
 
45
</title>
 
46
 
 
47
<para>
 
48
A keypair has a public key and a private key.
 
49
A public key consists of 
 
50
the public portion of the master signing key,
 
51
the public portions of the subordinate signing and encryption subkeys, and 
 
52
a set of user IDs used to associate the public key with a real person.
 
53
Each piece has data about itself.
 
54
For a key, this data includes its ID, when it was created, when it
 
55
will expire, etc.
 
56
For a user ID, this data includes the name of the real person it identifies,
 
57
an optional comment, and an email address.
 
58
The structure of the private key is similar, except that it contains only
 
59
the private portions of the keys, and there is no user ID information.
 
60
</para>
 
61
 
 
62
<para>
 
63
The command-line option 
 
64
<link linkend="edit-key"><option>--edit-key</option></link>
 
65
may be used to view a keypair.
 
66
For example,
 
67
 
 
68
<screen width="80">
 
69
<prompt>chloe%</prompt> <userinput>gpg --edit-key chloe@cyb.org</userinput>
 
70
Secret key is available.
 
71
 
 
72
pub  1024D/26B6AAE1  created: 1999-06-15 expires: never      trust: -/u
 
73
sub  2048g/0CF8CB7A  created: 1999-06-15 expires: never     
 
74
sub  1792G/08224617  created: 1999-06-15 expires: 2002-06-14
 
75
sub   960D/B1F423E7  created: 1999-06-15 expires: 2002-06-14
 
76
(1)  Chloe (Jester) &lt;chloe@cyb.org>
 
77
(2)  Chloe (Plebian) &lt;chloe@tel.net>
 
78
<prompt>Command></prompt>
 
79
</screen>
 
80
 
 
81
The public key is displayed along with an indication of whether
 
82
or not the private key is available.
 
83
Information about each component of the public key is then listed.
 
84
The first column indicates the type of the key.
 
85
The keyword <literal>pub</literal> identifies the public master signing key,
 
86
and the keyword <literal>sub</literal> identifies a public subordinate key.
 
87
The second column indicates the key's bit length, type, and ID.
 
88
The type is <literal>D</literal> for a DSA key, <literal>g</literal> for an 
 
89
encryption-only
 
90
ElGamal key, and <literal>G</literal> for an ElGamal key that may be used for
 
91
both encryption and signing.
 
92
The creation date and expiration date are given in columns three and four.
 
93
The user IDs are listed following the keys.
 
94
</para>
 
95
 
 
96
<para>
 
97
More information about the key can be obtained with interactive commands.
 
98
The command <link linkend="toggle"><command>toggle</command></link> 
 
99
switches between the public and private
 
100
components of a keypair if indeed both components are available.
 
101
 
 
102
<screen width="80">
 
103
<prompt>Command></prompt> <userinput>toggle</userinput>
 
104
               
 
105
sec  1024D/26B6AAE1  created: 1999-06-15 expires: never     
 
106
sbb  2048g/0CF8CB7A  created: 1999-06-15 expires: never     
 
107
sbb  1792G/08224617  created: 1999-06-15 expires: 2002-06-14
 
108
sbb   960D/B1F423E7  created: 1999-06-15 expires: 2002-06-14
 
109
(1)  Chloe (Jester) &lt;chloe@cyb.org>
 
110
(2)  Chloe (Plebian) &lt;chloe@tel.net>
 
111
</screen>
 
112
 
 
113
The information provided is similar to the listing for the public-key
 
114
component.
 
115
The keyword <literal>sec</literal> identifies the private master signing key,
 
116
and the keyword <literal>sbb</literal> identifies the private subordinates keys.
 
117
The user IDs from the public key are also listed for convenience.
 
118
</para>
 
119
 
 
120
<sect2>
 
121
<title id="integrity">
 
122
Key integrity
 
123
</title>
 
124
 
 
125
<para>
 
126
When you distribute your public key, you are distributing the public
 
127
components of your master and subordinate keys as well as the user IDs.
 
128
Distributing this material alone, however, is a security risk since
 
129
it is possible for an attacker to tamper with the key.
 
130
The public key can be modified by adding or substituting keys, or by
 
131
adding or changing user IDs.
 
132
By tampering with a user ID, the attacker could change the user ID's email
 
133
address to have email redirected to himself.
 
134
By changing one of the encryption keys, the attacker would
 
135
also be able to decrypt the messages redirected to him.
 
136
</para>
 
137
 
 
138
<para>
 
139
Using digital signatures is a solution to this problem.
 
140
When data is signed by a private key, the corresponding public key
 
141
is bound to the signed data.
 
142
In other words, only the corresponding public key can be used to
 
143
verify the signature and ensure that the data has not been modified.
 
144
A public key can be protected from tampering by using its corresponding
 
145
private master key to sign the public key components and user IDs, thus
 
146
binding the components to the public master key.
 
147
Signing public key components with the corresponding private master
 
148
signing key is called <firstterm>self-signing</firstterm>, and a public key that has
 
149
self-signed user IDs bound to it is called a <firstterm>certificate</firstterm>.
 
150
</para>
 
151
 
 
152
<!--
 
153
%\begin{figure}
 
154
%Blank
 
155
%\caption{This should depict how self-signatures bind information to
 
156
%a public key.}\label{fig:selfsignedkey}
 
157
%\end{figure}
 
158
%
 
159
%As an example, Figure~\ref{fig:selfsignedkey} illustrates Chloe's public
 
160
%key, which has been self-signed to bind the user IDs and public subkeys
 
161
%to the public master key.
 
162
%The signatures on the user IDs can be checked with the \texttt{check}
 
163
%command from the key edit menu.
 
164
-->
 
165
 
 
166
<para>
 
167
As an example, Chloe has two user IDs and three subkeys.
 
168
The signatures on the user IDs can be checked with the command
 
169
<link linkend="check"><command>check</command></link> from the key edit menu.
 
170
 
 
171
<screen width="80">
 
172
<prompt>chloe%</prompt> <userinput>gpg --edit-key chloe</userinput>
 
173
Secret key is available.
 
174
 
 
175
pub  1024D/26B6AAE1  created: 1999-06-15 expires: never      trust: -/u
 
176
sub  2048g/0CF8CB7A  created: 1999-06-15 expires: never     
 
177
sub  1792G/08224617  created: 1999-06-15 expires: 2002-06-14
 
178
sub   960D/B1F423E7  created: 1999-06-15 expires: 2002-06-14
 
179
(1)  Chloe (Jester) &lt;chloe@cyb.org>
 
180
(2)  Chloe (Plebian) &lt;chloe@tel.net>
 
181
 
 
182
<prompt>Command></prompt> <userinput>check</userinput>
 
183
uid  Chloe (Jester) &lt;chloe@cyb.org>
 
184
sig!       26B6AAE1 1999-06-15   [self-signature]
 
185
uid  Chloe (Plebian) &lt;chloe@tel.net>
 
186
sig!       26B6AAE1 1999-06-15   [self-signature]
 
187
</screen>
 
188
 
 
189
As expected, the signing key for each signature is the master signing
 
190
key with key ID <literal>0x26B6AAE1</literal>.
 
191
The self-signatures on the subkeys are present in the public key, but
 
192
they are not shown by the &gnupg; interface.
 
193
</para>
 
194
</sect2>
 
195
 
 
196
<sect2>
 
197
<title>
 
198
Adding and deleting key components
 
199
</title>
 
200
 
 
201
<para>
 
202
Both new subkeys and new user IDs may be added to your keypair after
 
203
it has been created.
 
204
A user ID is added using the command 
 
205
<link linkend="adduid"><command>adduid</command></link>.
 
206
You are prompted for a real name, email address, and comment just
 
207
as when you create an initial keypair.
 
208
A subkey is added using the command 
 
209
<link linkend="addkey"><command>addkey</command></link>.
 
210
The interface is similar to the interface used when creating an initial
 
211
keypair.
 
212
The subkey may be a DSA signing key, and encrypt-only ElGamal
 
213
key, or a sign-and-encrypt ElGamal key.
 
214
When a subkey or user ID is generated it is self-signed using your 
 
215
master signing key, which is why you must supply your passphrase
 
216
when the key is generated.
 
217
</para>
 
218
 
 
219
<para>
 
220
Additional user IDs are useful when you need multiple identities.
 
221
For example, you may have an identity for your job and an identity
 
222
for your work as a political activist.
 
223
Coworkers will know you by your work user ID.
 
224
Coactivists will know you by your activist user ID.
 
225
Since those groups of people may not overlap, though, each group
 
226
may not trust the other user ID.
 
227
Both user IDs are therefore necessary.
 
228
</para>
 
229
 
 
230
<para>
 
231
Additional subkeys are also useful.
 
232
The user IDs associated with your public master key are validated by
 
233
the people with whom you
 
234
communicate, and changing the master key therefore requires recertification.
 
235
This may be difficult and time consuming if you communicate with
 
236
many people.
 
237
On the other hand, it is good to periodically change encryption subkeys.
 
238
If a key is broken, all the data encrypted with that key will be
 
239
vulnerable.
 
240
By changing keys, however, only the data encrypted with the one broken
 
241
key will be revealed.
 
242
</para>
 
243
 
 
244
<para>
 
245
Subkeys and user IDs may also be deleted.
 
246
To delete a subkey or user ID you must first select it using the
 
247
<link linkend="key"><command>key</command></link> or 
 
248
<link linkend="uid"><command>uid</command></link> commands respectively.
 
249
These commands are toggles.
 
250
For example, the command <command>key <parameter>2</parameter></command> 
 
251
selects the second subkey,
 
252
and invoking <command>key <parameter>2</parameter></command> again 
 
253
deselects it.
 
254
If no extra argument is given, all subkeys or user IDs are deselected.
 
255
Once the user IDs to be deleted are selected, the command
 
256
<link linkend="deluid"><command>deluid</command></link>
 
257
actually deletes the user IDs from your key.
 
258
Similarly, the command <link linkend="delkey"><command>delkey</command></link>
 
259
deletes all selected subkeys from both your public and private keys.
 
260
</para>
 
261
 
 
262
<para>
 
263
For local keyring management, deleting key components is a good way
 
264
to trim other people's public keys of unnecessary material.
 
265
Deleting user IDs and subkeys on your own key, however, is not always
 
266
wise since it complicates key distribution.
 
267
By default, when a user imports your updated public key it will be merged
 
268
with the old copy of your public key on his ring if it exists.
 
269
The components from both keys are combined in the merge, and this
 
270
effectively restores any components you deleted.
 
271
To properly update the key, the user must first delete the old version
 
272
of your key and then import the new version.
 
273
This puts an extra burden on the people with whom you communicate.
 
274
Furthermore, if you send your key to a keyserver, the merge will
 
275
happen regardless, and anybody who downloads your key from a keyserver
 
276
will never see your key with components deleted.
 
277
Consequently, for updating your own key it is better to revoke key
 
278
components instead of deleting them.
 
279
</para>
 
280
</sect2>
 
281
 
 
282
<sect2>
 
283
<title>
 
284
Revoking key components
 
285
</title>
 
286
 
 
287
<para>
 
288
To revoke a subkey it must be selected.
 
289
Once selected it may be revoked with the 
 
290
<link linkend="revkey"><command>revkey</command></link> command.
 
291
The key is revoked by adding a revocation self-signature to the key.
 
292
Unlike the command-line option <option>--gen-revoke</option>, the effect of
 
293
revoking a subkey is immediate.
 
294
</para>
 
295
 
 
296
<screen width="80">
 
297
<prompt>Command></prompt> <userinput>revkey</userinput>
 
298
Do you really want to revoke this key? y
 
299
                                        
 
300
You need a passphrase to unlock the secret key for
 
301
user: "Chloe (Jester) &lt;chloe@cyb.org>"
 
302
1024-bit DSA key, ID B87DBA93, created 1999-06-28
 
303
 
 
304
                  
 
305
pub  1024D/B87DBA93  created: 1999-06-28 expires: never      trust: -/u
 
306
sub  2048g/B7934539  created: 1999-06-28 expires: never     
 
307
sub  1792G/4E3160AD  created: 1999-06-29 expires: 2000-06-28
 
308
rev! subkey has been revoked: 1999-06-29
 
309
sub   960D/E1F56448  created: 1999-06-29 expires: 2000-06-28
 
310
(1)  Chloe (Jester) &lt;chloe@cyb.org>
 
311
(2)  Chloe (Plebian) &lt;chloe@tel.net>
 
312
</screen>
 
313
 
 
314
<para>
 
315
A user ID is revoked differently.
 
316
Normally, a user ID collects signatures that attest that the user ID
 
317
describes the person who actually owns the associated key.
 
318
In theory, a user ID describes a person forever, since that person will
 
319
never change.
 
320
In practice, though, elements of the user ID such as the email address
 
321
and comment may change over time, thus invalidating the user ID.
 
322
</para>
 
323
 
 
324
<para>
 
325
The OpenPGP
 
326
<comment>First reference to OpenPGP</comment>
 
327
specification does not support user ID revocation, but
 
328
a user ID can effectively be revoked by revoking the self-signature
 
329
on the user ID.
 
330
For the security reasons described 
 
331
<link linkend="integrity">previously</link>,
 
332
correspondents will not trust a user ID with no valid self-signature.
 
333
</para>
 
334
 
 
335
<para>
 
336
A signature is revoked by using the command 
 
337
<link linkend="revsig"><command>revsig</command></link>.
 
338
Since you may have signed any number of user IDs, the user interface
 
339
prompts you to decide for each signature whether or not to revoke it.
 
340
</para>
 
341
 
 
342
<screen width="80">
 
343
<prompt>Command></prompt> <userinput>revsig</userinput>
 
344
You have signed these user IDs:
 
345
     Chloe (Jester) &lt;chloe@cyb.org>
 
346
   signed by B87DBA93 at 1999-06-28
 
347
     Chloe (Plebian) &lt;chloe@tel.net>
 
348
   signed by B87DBA93 at 1999-06-28
 
349
user ID: "Chloe (Jester) &lt;chloe@cyb.org>"
 
350
signed with your key B87DBA93 at 1999-06-28
 
351
Create a revocation certificate for this signature? (y/N)n
 
352
user ID: "Chloe (Plebian) &lt;chloe@tel.net>"                
 
353
signed with your key B87DBA93 at 1999-06-28
 
354
Create a revocation certificate for this signature? (y/N)y
 
355
You are about to revoke these signatures:                 
 
356
     Chloe (Plebian) &lt;chloe@tel.net>
 
357
   signed by B87DBA93 at 1999-06-28
 
358
Really create the revocation certificates? (y/N)y
 
359
                                                 
 
360
You need a passphrase to unlock the secret key for
 
361
user: "Chloe (Jester) &lt;chloe@cyb.org>"
 
362
1024-bit DSA key, ID B87DBA93, created 1999-06-28
 
363
 
 
364
                  
 
365
pub  1024D/B87DBA93  created: 1999-06-28 expires: never      trust: -/u
 
366
sub  2048g/B7934539  created: 1999-06-28 expires: never     
 
367
sub  1792G/4E3160AD  created: 1999-06-29 expires: 2000-06-28
 
368
rev! subkey has been revoked: 1999-06-29
 
369
sub   960D/E1F56448  created: 1999-06-29 expires: 2000-06-28
 
370
(1)  Chloe (Jester) &lt;chloe@cyb.org>
 
371
(2)  Chloe (Plebian) &lt;chloe@tel.net>
 
372
</screen>
 
373
 
 
374
<para>
 
375
A revoked user ID is indicated by the revocation signature on 
 
376
the ID when the signatures on the key's user IDs are listed.
 
377
</para>
 
378
 
 
379
<screen width="80">
 
380
<prompt>Command></prompt> <userinput>check</userinput>
 
381
uid  Chloe (Jester) &lt;chloe@cyb.org>
 
382
sig!       B87DBA93 1999-06-28   [self-signature]
 
383
uid  Chloe (Plebian) &lt;chloe@tel.net>
 
384
rev!       B87DBA93 1999-06-29   [revocation]
 
385
sig!       B87DBA93 1999-06-28   [self-signature]
 
386
</screen>
 
387
 
 
388
<para>
 
389
Revoking both subkeys and self-signatures on user IDs adds revocation
 
390
self-signatures to the key.
 
391
Since signatures are being added and no material is deleted, a 
 
392
revocation will always be visible to others when your updated public
 
393
key is distributed and merged with older copies of it.
 
394
Revocation therefore guarantees that everybody has a consistent
 
395
copy of your public key.
 
396
</para>
 
397
</sect2>
 
398
 
 
399
<sect2>
 
400
<title>
 
401
Updating a key's expiration time
 
402
</title>
 
403
 
 
404
<para>
 
405
The expiration time of a key may be updated with the command
 
406
<link linkend="expire"><command>expire</command></link> from the key edit menu.
 
407
If no key is selected the expiration time of the primary key
 
408
is updated.
 
409
Otherwise the expiration time of the selected subordinate key
 
410
is updated.
 
411
</para>
 
412
 
 
413
<para>
 
414
A key's expiration time is associated with the key's self-signature.
 
415
The expiration time is updated by deleting the old self-signature
 
416
and adding a new self-signature.
 
417
Since correspondents will not have deleted the old self-signature, they
 
418
will see an additional self-signature on the key when they update
 
419
their copy of your key.
 
420
The latest self-signature takes precedence, however, so all correspondents
 
421
will unambiguously know the expiration times of your keys.
 
422
</para>
 
423
</sect2>
 
424
</sect1>
 
425
 
 
426
<sect1>
 
427
<title>
 
428
Validating other keys on your public keyring
 
429
</title>
 
430
 
 
431
<para>
 
432
In Chapter <xref linkend="intro"> a procedure was given to validate your
 
433
correspondents' public keys: a correspondent's key is validated by
 
434
personally checking his key's fingerprint and then signing his public
 
435
key with your private key.
 
436
By personally checking the fingerprint you can be sure that the
 
437
key really does belong to him, and since you have signed they key, you
 
438
can be sure to detect any tampering with it in the future.
 
439
Unfortunately, this procedure is awkward when either you must validate
 
440
a large number of keys or communicate with people whom you do not
 
441
know personally.
 
442
</para>
 
443
 
 
444
<para>
 
445
&Gnupg; addresses this problem with a mechanism popularly known
 
446
as the <firstterm>web of trust</firstterm>.
 
447
In the web of trust model, responsibility for validating public
 
448
keys is delegated to people you trust.
 
449
For example, suppose
 
450
<itemizedlist spacing="compact">
 
451
<listitem>
 
452
<para>
 
453
Alice has signed Blake's key, and
 
454
</para>
 
455
</listitem>
 
456
<listitem>
 
457
<para>
 
458
Blake has signed Chloe's key and Dharma's key.
 
459
</para>
 
460
</listitem>
 
461
</itemizedlist>
 
462
 
 
463
If Alice trusts Blake to properly validate keys that he signs, then
 
464
Alice can infer that Chloe's and Dharma's keys are valid without 
 
465
having to personally check them.
 
466
She simply uses her validated copy of Blake's public key to
 
467
check that Blake's signatures on Chloe's and Dharma's are good.
 
468
In general, assuming that Alice fully trusts everybody to properly
 
469
validate keys they sign, then any key signed by a valid key is also
 
470
considered valid.
 
471
The root is Alice's key, which is axiomatically assumed to be valid.
 
472
</para>
 
473
 
 
474
<sect2>
 
475
<title>
 
476
Trust in a key's owner
 
477
</title>
 
478
 
 
479
<para>
 
480
In practice trust is subjective.
 
481
For example, Blake's key is valid to Alice since she signed it, but she
 
482
may not trust Blake to properly validate keys that he signs.
 
483
In that case, she would not take Chloe's and Dharma's key as valid
 
484
based on Blake's signatures alone.
 
485
The web of trust model accounts for this by associating with each
 
486
public key on your keyring an indication of how much you trust the
 
487
key's owner.
 
488
There are four trust levels.
 
489
 
 
490
<variablelist>
 
491
<varlistentry>
 
492
<term>
 
493
unknown
 
494
</term>
 
495
<listitem>
 
496
<para>
 
497
Nothing is known about the owner's judgement in key signing.
 
498
Keys on your public keyring that you do not own initially have
 
499
this trust level.
 
500
</para>
 
501
</listitem>
 
502
</varlistentry>
 
503
<varlistentry>
 
504
<term>
 
505
none
 
506
</term>
 
507
<listitem>
 
508
<para>
 
509
The owner is known to improperly sign other keys.
 
510
</para>
 
511
</listitem>
 
512
</varlistentry>
 
513
<varlistentry>
 
514
<term>
 
515
marginal
 
516
</term>
 
517
<listitem>
 
518
<para>
 
519
The owner understands the implications of key signing and 
 
520
properly validates keys before signing them.
 
521
</para>
 
522
</listitem>
 
523
</varlistentry>
 
524
<varlistentry>
 
525
<term>
 
526
full
 
527
</term>
 
528
<listitem>
 
529
<para>
 
530
The owner has an excellent understanding of key signing,
 
531
and his signature on a key would be as good as your own.
 
532
</para>
 
533
</listitem>
 
534
</varlistentry>
 
535
</variablelist>
 
536
 
 
537
A key's trust level is something that you alone assign to the
 
538
key, and it is considered private information.
 
539
It is not packaged with the key when it is exported; it is even
 
540
stored separately from your keyrings in a separate database.
 
541
</para>
 
542
 
 
543
<para>
 
544
The &gnupg; key editor may be used to adjust your trust in a key's owner.
 
545
The command is <link linkend="trust"><command>trust</command></link>.
 
546
In this example Alice edits her trust in Blake and then updates
 
547
the trust database to recompute which keys are valid based on her new
 
548
trust in Blake.
 
549
 
 
550
<screen width="80">
 
551
<prompt>alice%</prompt> <userinput>gpg --edit-key blake</userinput>
 
552
 
 
553
pub  1024D/8B927C8A  created: 1999-07-02 expires: never      trust: q/f
 
554
sub  1024g/C19EA233  created: 1999-07-02 expires: never     
 
555
(1)  Blake (Executioner) &lt;blake@cyb.org>
 
556
 
 
557
<prompt>Command></prompt> <userinput>trust</userinput>
 
558
pub  1024D/8B927C8A  created: 1999-07-02 expires: never      trust: q/f
 
559
sub  1024g/C19EA233  created: 1999-07-02 expires: never     
 
560
(1)  Blake (Executioner) &lt;blake@cyb.org>
 
561
 
 
562
Please decide how far you trust this user to correctly
 
563
verify other users' keys (by looking at passports,
 
564
checking fingerprints from different sources...)?
 
565
 
 
566
 1 = Don't know
 
567
 2 = I do NOT trust
 
568
 3 = I trust marginally
 
569
 4 = I trust fully
 
570
 s = please show me more information
 
571
 m = back to the main menu
 
572
 
 
573
<prompt>Your decision?</prompt> <userinput>3</userinput>
 
574
                
 
575
pub  1024D/8B927C8A  created: 1999-07-02 expires: never      trust: m/f
 
576
sub  1024g/C19EA233  created: 1999-07-02 expires: never     
 
577
(1)  Blake (Executioner) &lt;blake@cyb.org>
 
578
 
 
579
<prompt>Command></prompt> <userinput>quit</userinput>
 
580
[...]
 
581
</screen>
 
582
 
 
583
Trust in the key's owner and the key's validity are indicated to the
 
584
right when the key is displayed.
 
585
Trust in the owner is displayed first and the key's validity is 
 
586
<!-- HERE, need to fix quotation marks -->
 
587
second<footnote>
 
588
<para>
 
589
&Gnupg; overloads the word "trust" by using it to mean
 
590
trust in an owner and trust in a key.
 
591
This can be confusing.
 
592
Sometimes trust in an owner is referred to as
 
593
<firstterm>owner-trust</firstterm> to
 
594
distinguish it from trust in a key.
 
595
<!-- HERE, need to fix quotation marks -->
 
596
Throughout this manual, however, "trust" is used to 
 
597
mean trust in a key's
 
598
<!-- HERE, need to fix quotation marks -->
 
599
owner, and "validity" is used to mean trust that a key 
 
600
belongs to the human associated with the key ID.
 
601
</para>
 
602
</footnote>.
 
603
The four trust/validity levels are abbreviated: unknown (<literal>q</literal>),
 
604
none (<literal>n</literal>), marginal (<literal>m</literal>), and 
 
605
full (<literal>f</literal>).
 
606
In this case, Blake's key is fully valid since Alice signed it herself.
 
607
She initially has an unknown trust in Blake to properly sign other keys
 
608
but decides to trust him marginally.
 
609
</para>
 
610
</sect2>
 
611
 
 
612
<sect2>
 
613
<title>
 
614
Using trust to validate keys
 
615
</title>
 
616
 
 
617
<para>
 
618
The web of trust allows a more elaborate algorithm to be used to
 
619
validate a key.
 
620
Formerly, a key was considered valid only if you signed it personally.
 
621
<!-- HERE, math -->
 
622
A more flexible algorithm can now be used: a key <emphasis>K</emphasis> is considered valid
 
623
if it meets two conditions:
 
624
<orderedlist spacing="compact">
 
625
<listitem>
 
626
<para>
 
627
it is signed by enough valid keys, meaning
 
628
<itemizedlist spacing="compact">
 
629
<listitem>
 
630
<para>
 
631
you have signed it personally, 
 
632
</para>
 
633
</listitem>
 
634
<listitem>
 
635
<para>
 
636
it has been signed by one fully trusted key, or
 
637
</para>
 
638
</listitem>
 
639
<listitem>
 
640
<para>
 
641
it has been signed by three marginally trusted keys; and
 
642
</para>
 
643
</listitem>
 
644
</itemizedlist>
 
645
</para>
 
646
</listitem>
 
647
<listitem>
 
648
<para>
 
649
<!-- HERE, math -->
 
650
the path of signed keys leading from <emphasis>K</emphasis> back 
 
651
to your own key is five steps or shorter.
 
652
</para>
 
653
</listitem>
 
654
</orderedlist>
 
655
 
 
656
The path length, number of marginally trusted keys required, and number
 
657
of fully trusted keys required may be adjusted.
 
658
The numbers given above are the default values used by &gnupg;.
 
659
</para>
 
660
 
 
661
<para>
 
662
<xref linkend="wot-examples"> shows a web of trust rooted at Alice.
 
663
The graph illustrates who has signed who's keys.
 
664
The table shows which keys Alice considers valid based on her
 
665
trust in the other members of the web.
 
666
<comment>Potential bug: <option>--completes-needed</option> on command 
 
667
line seems to be ignored when combined with <option>--update-trustdb</option>.
 
668
Value is taken correctly if put in options file, however.</comment>
 
669
This example assumes that two marginally-trusted keys or one
 
670
fully-trusted key is needed to validate another key.
 
671
The maximum path length is three.
 
672
</para>
 
673
 
 
674
<para>
 
675
When computing valid keys in the example, Blake and Dharma's are
 
676
always considered fully valid since they were signed directly
 
677
by Alice.
 
678
The validity of the other keys depends on trust.
 
679
In the first case, Dharma is trusted fully, which implies 
 
680
that Chloe's and Francis's keys will be considered valid.
 
681
In the second example, Blake and Dharma are trusted marginally.
 
682
Since two marginally trusted keys are needed to fully validate a
 
683
key, Chloe's key will be considered fully valid, but Francis's 
 
684
key will be considered only marginally valid.
 
685
In the case where Chloe and Dharma are marginally trusted,
 
686
Chloe's key will be marginally valid since Dharma's key is
 
687
fully valid.
 
688
Francis's key, however, will also be considered marginally
 
689
valid since only a fully valid key can be used to validate
 
690
other keys, and Dharma's key is the only fully valid key
 
691
that has been used to sign Francis's key.
 
692
When marginal trust in Blake is added, Chloe's key becomes
 
693
fully valid and can then be used to fully validate Francis's
 
694
key and marginally validate Elena's key.
 
695
Lastly, when Blake, Chloe, and Elena are fully trusted, this is
 
696
still insufficient to validate Geoff's key since the maximum
 
697
certification path is three, but the path length from Geoff
 
698
back to Alice is four.
 
699
</para>
 
700
 
 
701
<para>
 
702
The web of trust model is a flexible approach to the problem of safe
 
703
public key exchange.
 
704
It permits you to tune &gnupg; to reflect how you use it.
 
705
At one extreme you may insist on multiple, short paths from your
 
706
<!-- HERE, math -->
 
707
key to another key <emphasis>K</emphasis> in order to trust it.
 
708
On the other hand, you may be satisfied with longer paths and
 
709
<!-- HERE, math -->
 
710
perhaps as little as one path from your key to the other 
 
711
key <emphasis>K</emphasis>.
 
712
<!-- HERE, math -->
 
713
Requiring multiple, short paths is a strong guarantee 
 
714
that <emphasis>K</emphasis> belongs to whom your think it does.
 
715
The price, of course, is that it is more difficult to validate keys
 
716
since you must personally sign more keys than if you accepted fewer
 
717
and longer paths.
 
718
</para>
 
719
 
 
720
<figure id="wot-examples" float=1>
 
721
<title>
 
722
A hypothetical web of trust
 
723
</title>
 
724
<!--
 
725
The graph indicates who has signed who's keys.
 
726
The table, in which names have been abbreviated, shows which keys are 
 
727
valid depending on how Alice trusts other members in the web.
 
728
Alice considers different keys valid depending on how she trusts
 
729
the members of the web.
 
730
-->
 
731
 
 
732
<graphic fileref="signatures.jpg"></graphic>
 
733
 
 
734
<informaltable frame="all">
 
735
<tgroup cols="4" rowsep="1" colsep="1">
 
736
<colspec colname="one" colnum="1">
 
737
<colspec colname="two" colnum="2">
 
738
<colspec colname="three" colnum="3">
 
739
<colspec colname="four" colnum="4">
 
740
<spanspec spanname="lefthalf" namest="one" nameend="two" align="center">
 
741
<spanspec spanname="righthalf" namest="three" nameend="four" align="center">
 
742
 
 
743
<thead>
 
744
<colspec
 
745
<row>
 
746
<entry spanname="lefthalf">trust</entry>
 
747
<entry spanname="righthalf">validity</entry>
 
748
</row>
 
749
<row>
 
750
<entry align="center">marginal</entry>
 
751
<entry align="center">full</entry>
 
752
<entry align="center">marginal</entry>
 
753
<entry align="center">full</entry>
 
754
</row>
 
755
</thead>
 
756
<tbody>
 
757
<row>
 
758
<entry></entry>
 
759
<entry>Dharma</entry>
 
760
<entry></entry>
 
761
<entry>Blake, Chloe, Dharma, Francis</entry>
 
762
</row>
 
763
 
 
764
<row>
 
765
<entry>Blake, Dharma</entry>
 
766
<entry></entry>
 
767
<entry>Francis</entry>
 
768
<entry>Blake, Chloe, Dharma</entry>
 
769
</row>
 
770
 
 
771
<row>
 
772
<entry>Chloe, Dharma</entry>
 
773
<entry></entry>
 
774
<entry>Chloe, Francis</entry>
 
775
<entry>Blake, Dharma</entry>
 
776
</row>
 
777
 
 
778
<row>
 
779
<entry>Blake, Chloe, Dharma</entry>
 
780
<entry></entry>
 
781
<entry>Elena</entry>
 
782
<entry>Blake, Chloe, Dharma, Francis</entry>
 
783
</row>
 
784
 
 
785
<row>
 
786
<entry></entry>
 
787
<entry>Blake, Chloe, Elena</entry>
 
788
<entry></entry>
 
789
<entry>Blake, Chloe, Elena, Francis</entry>
 
790
</row>
 
791
</tbody>
 
792
</tgroup>
 
793
</informaltable>
 
794
</figure>
 
795
</sect2>
 
796
</sect1>
 
797
 
 
798
<sect1>
 
799
<title>
 
800
Distributing keys
 
801
</title>
 
802
 
 
803
<para>
 
804
Ideally, you distribute your key by personally giving it to your
 
805
correspondents.
 
806
In practice, however, keys are often distributed by email or some
 
807
other electronic communication medium.
 
808
Distribution by email is good practice when you have only a few
 
809
correspondents, and even if you have many correspondents, you can use
 
810
an alternative means such as posting your public key on your World Wide
 
811
Web homepage.
 
812
This is unacceptable, however, if people who need your public key do
 
813
not know where to find it on the Web.
 
814
</para>
 
815
 
 
816
<para>
 
817
To solve this problem public key servers are used to collect
 
818
and distribute public keys.
 
819
A public key received by the server is either added to the server's
 
820
database or merged with the existing key if already present.
 
821
When a key request comes to the server, the server consults its
 
822
database and returns the requested public key if found.
 
823
</para>
 
824
 
 
825
<para>
 
826
A keyserver is also valuable when many people are frequently signing other
 
827
people's keys.
 
828
Without a keyserver, when Blake sign's Alice's key then Blake would send
 
829
Alice a copy of her public key signed by him so that Alice could
 
830
add the updated key to her ring as well as distribute it to all of her
 
831
correspondents.
 
832
Going through this effort fulfills Alice's and Blake's responsibility 
 
833
to the community at large in building tight webs of trust and thus
 
834
improving the security of PGP.
 
835
It is nevertheless a nuisance if key signing is frequent.
 
836
</para>
 
837
 
 
838
<para>
 
839
Using a keyserver makes the process somewhat easier.
 
840
When Blake signs Alice's key he sends the signed key to the key server.
 
841
The key server adds Blake's signature to its copy of Alice's key.
 
842
Individuals interested in updating their copy of Alice's key then consult
 
843
the keyserver on their own initiative to retrieve the updated key.
 
844
Alice need never be involved with distribution and can retrieve signatures
 
845
on her key simply by querying a keyserver.
 
846
<comment><option>--keyserver</option> must come before
 
847
<option>--send-key</option> or <option>--recv-key</option>.  
 
848
This appears to be a bug.</comment>
 
849
</para>
 
850
 
 
851
<para>
 
852
One or more keys may be sent to a keyserver using the command-line
 
853
option <link linkend="send-keys"><option>--send-keys</option></link>.
 
854
The option takes one or more key specifiers and sends the specified
 
855
keys to the key server.
 
856
The key server to which to send the keys is specified with the
 
857
command-line option <link linkend="keyserver"><option>--keyserver</option></link>.
 
858
Similarly, the option 
 
859
<link linkend="recv-keys"><option>--recv-keys</option></link> is used 
 
860
to retrieve keys from a keyserver, but the option <option>--recv-keys</option>
 
861
requires a key ID be used to specify the key.
 
862
In the following example Alice sends her public key to the keyserver
 
863
<parameter>certserver.pgp.com</parameter> and then updates her copy 
 
864
of Blake's key from the same keyserver.
 
865
 
 
866
<screen width="80">
 
867
<prompt>alice%</prompt> <userinput>gpg --keyserver certserver.pgp.com --recv-key 0xBB7576AC</userinput>
 
868
gpg: requesting key BB7576AC from certserver.pgp.com ...
 
869
gpg: key BB7576AC: 1 new signature
 
870
 
 
871
gpg: Total number processed: 1
 
872
gpg:         new signatures: 1
 
873
<prompt>alice%</prompt> <userinput>gpg --keyserver certserver.pgp.com --send-key blake@cyb.org</userinput>
 
874
gpg: success sending to 'certserver.pgp.com' (status=200)
 
875
</screen>
 
876
 
 
877
There are several popular keyservers in use around the world.
 
878
The major keyservers synchronize themselves, so it is fine to
 
879
pick a keyserver close to you on the Internet and then use it
 
880
regularly for sending and receiving keys.
 
881
</para>
 
882
</sect1>
 
883
 
 
884
</chapter>
 
885