/usr/share/doc/gnupg-doc/GNU_Privacy_Handbook/html/c236.htm is in gnupg-doc 2003.04.06+dak1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Key Management</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The GNU Privacy Handbook"
HREF="book1.htm"><LINK
REL="PREVIOUS"
TITLE="Digital signatures"
HREF="x216.htm"><LINK
REL="NEXT"
TITLE="Validating other keys on your public keyring"
HREF="x335.htm"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The GNU Privacy Handbook</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x216.htm"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x335.htm"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="MANAGEMENT"
></A
>Chapter 3. Key Management</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="c236.htm#AEN244"
>Managing your own keypair</A
></DT
><DT
><A
HREF="x335.htm"
>Validating other keys on your public keyring</A
></DT
><DT
><A
HREF="x464.htm"
>Distributing keys</A
></DT
></DL
></DIV
><P
>Key tampering is a major security weakness with public-key cryptography.
An eavesdropper may tamper with a user's keyrings or forge a
user's public key and post it for others to download and use.
For example, suppose Chloe wants to monitor the messages that Alice
sends to Blake.
She could mount what is called a <I
CLASS="FIRSTTERM"
>man in the
middle</I
> attack.
In this attack, Chloe creates a new public/private keypair.
She replaces Alice's copy of Blake's public key with the new public key.
She then intercepts the messages that Alice sends to Blake.
For each intercept, she decrypts it using the new private key, reencrypts
it using Blake's true public key, and forwards the reencrypted
message to Blake.
All messages sent from Alice to Blake can now be read by Chloe.</P
><P
>Good key management is crucial in order to ensure not just the integrity
of your keyrings but the integrity of other users' keyrings as well.
The core of key management in GnuPG is the notion of signing keys.
Key signing has two main purposes: it permits you to detect tampering
on your keyring, and it allows you to certify that a key truly belongs
to the person named by a user ID on the key.
Key signatures are also used in a scheme known as the <I
CLASS="FIRSTTERM"
>web of
trust</I
> to extend certification to keys not directly signed by you
but signed by others you trust.
Responsible users who practice good key management can defeat key
tampering as a practical attack on secure communication with GnuPG.</P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN244"
>Managing your own keypair</A
></H1
><P
>A keypair has a public key and a private key.
A public key consists of
the public portion of the master signing key,
the public portions of the subordinate signing and encryption subkeys, and
a set of user IDs used to associate the public key with a real person.
Each piece has data about itself.
For a key, this data includes its ID, when it was created, when it
will expire, etc.
For a user ID, this data includes the name of the real person it identifies,
an optional comment, and an email address.
The structure of the private key is similar, except that it contains only
the private portions of the keys, and there is no user ID information.</P
><P
>The command-line option
<CODE
CLASS="OPTION"
>--edit-key</CODE
>
may be used to view a keypair.
For example,
<PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>chloe%</TT
> <KBD
CLASS="USERINPUT"
>gpg --edit-key chloe@cyb.org</KBD
>
Secret key is available.
pub 1024D/26B6AAE1 created: 1999-06-15 expires: never trust: -/u
sub 2048g/0CF8CB7A created: 1999-06-15 expires: never
sub 1792G/08224617 created: 1999-06-15 expires: 2002-06-14
sub 960D/B1F423E7 created: 1999-06-15 expires: 2002-06-14
(1) Chloe (Jester) <chloe@cyb.org>
(2) Chloe (Plebian) <chloe@tel.net>
<TT
CLASS="PROMPT"
>Command></TT
></PRE
>
The public key is displayed along with an indication of whether
or not the private key is available.
Information about each component of the public key is then listed.
The first column indicates the type of the key.
The keyword <TT
CLASS="LITERAL"
>pub</TT
> identifies the public master signing key,
and the keyword <TT
CLASS="LITERAL"
>sub</TT
> identifies a public subordinate key.
The second column indicates the key's bit length, type, and ID.
The type is <TT
CLASS="LITERAL"
>D</TT
> for a DSA key, <TT
CLASS="LITERAL"
>g</TT
> for an
encryption-only
ElGamal key, and <TT
CLASS="LITERAL"
>G</TT
> for an ElGamal key that may be used for
both encryption and signing.
The creation date and expiration date are given in columns three and four.
The user IDs are listed following the keys.</P
><P
>More information about the key can be obtained with interactive commands.
The command <B
CLASS="COMMAND"
>toggle</B
>
switches between the public and private
components of a keypair if indeed both components are available.
<PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>Command></TT
> <KBD
CLASS="USERINPUT"
>toggle</KBD
>
sec 1024D/26B6AAE1 created: 1999-06-15 expires: never
sbb 2048g/0CF8CB7A created: 1999-06-15 expires: never
sbb 1792G/08224617 created: 1999-06-15 expires: 2002-06-14
sbb 960D/B1F423E7 created: 1999-06-15 expires: 2002-06-14
(1) Chloe (Jester) <chloe@cyb.org>
(2) Chloe (Plebian) <chloe@tel.net></PRE
>
The information provided is similar to the listing for the public-key
component.
The keyword <TT
CLASS="LITERAL"
>sec</TT
> identifies the private master signing key,
and the keyword <TT
CLASS="LITERAL"
>sbb</TT
> identifies the private subordinates keys.
The user IDs from the public key are also listed for convenience.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN267"
>Key integrity</A
></H2
><P
>When you distribute your public key, you are distributing the public
components of your master and subordinate keys as well as the user IDs.
Distributing this material alone, however, is a security risk since
it is possible for an attacker to tamper with the key.
The public key can be modified by adding or substituting keys, or by
adding or changing user IDs.
By tampering with a user ID, the attacker could change the user ID's email
address to have email redirected to himself.
By changing one of the encryption keys, the attacker would
also be able to decrypt the messages redirected to him.</P
><P
>Using digital signatures is a solution to this problem.
When data is signed by a private key, the corresponding public key
is bound to the signed data.
In other words, only the corresponding public key can be used to
verify the signature and ensure that the data has not been modified.
A public key can be protected from tampering by using its corresponding
private master key to sign the public key components and user IDs, thus
binding the components to the public master key.
Signing public key components with the corresponding private master
signing key is called <I
CLASS="FIRSTTERM"
>self-signing</I
>, and a public key that has
self-signed user IDs bound to it is called a <I
CLASS="FIRSTTERM"
>certificate</I
>.</P
><P
>As an example, Chloe has two user IDs and three subkeys.
The signatures on the user IDs can be checked with the command
<B
CLASS="COMMAND"
>check</B
> from the key edit menu.
<PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>chloe%</TT
> <KBD
CLASS="USERINPUT"
>gpg --edit-key chloe</KBD
>
Secret key is available.
pub 1024D/26B6AAE1 created: 1999-06-15 expires: never trust: -/u
sub 2048g/0CF8CB7A created: 1999-06-15 expires: never
sub 1792G/08224617 created: 1999-06-15 expires: 2002-06-14
sub 960D/B1F423E7 created: 1999-06-15 expires: 2002-06-14
(1) Chloe (Jester) <chloe@cyb.org>
(2) Chloe (Plebian) <chloe@tel.net>
<TT
CLASS="PROMPT"
>Command></TT
> <KBD
CLASS="USERINPUT"
>check</KBD
>
uid Chloe (Jester) <chloe@cyb.org>
sig! 26B6AAE1 1999-06-15 [self-signature]
uid Chloe (Plebian) <chloe@tel.net>
sig! 26B6AAE1 1999-06-15 [self-signature]</PRE
>
As expected, the signing key for each signature is the master signing
key with key ID <TT
CLASS="LITERAL"
>0x26B6AAE1</TT
>.
The self-signatures on the subkeys are present in the public key, but
they are not shown by the GnuPG interface.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN282"
>Adding and deleting key components</A
></H2
><P
>Both new subkeys and new user IDs may be added to your keypair after
it has been created.
A user ID is added using the command
<B
CLASS="COMMAND"
>adduid</B
>.
You are prompted for a real name, email address, and comment just
as when you create an initial keypair.
A subkey is added using the command
<B
CLASS="COMMAND"
>addkey</B
>.
The interface is similar to the interface used when creating an initial
keypair.
The subkey may be a DSA signing key, and encrypt-only ElGamal
key, or a sign-and-encrypt ElGamal key.
When a subkey or user ID is generated it is self-signed using your
master signing key, which is why you must supply your passphrase
when the key is generated.</P
><P
>Additional user IDs are useful when you need multiple identities.
For example, you may have an identity for your job and an identity
for your work as a political activist.
Coworkers will know you by your work user ID.
Coactivists will know you by your activist user ID.
Since those groups of people may not overlap, though, each group
may not trust the other user ID.
Both user IDs are therefore necessary.</P
><P
>Additional subkeys are also useful.
The user IDs associated with your public master key are validated by
the people with whom you
communicate, and changing the master key therefore requires recertification.
This may be difficult and time consuming if you communicate with
many people.
On the other hand, it is good to periodically change encryption subkeys.
If a key is broken, all the data encrypted with that key will be
vulnerable.
By changing keys, however, only the data encrypted with the one broken
key will be revealed.</P
><P
>Subkeys and user IDs may also be deleted.
To delete a subkey or user ID you must first select it using the
<B
CLASS="COMMAND"
>key</B
> or
<B
CLASS="COMMAND"
>uid</B
> commands respectively.
These commands are toggles.
For example, the command <B
CLASS="COMMAND"
>key <TT
CLASS="PARAMETER"
><I
>2</I
></TT
></B
>
selects the second subkey,
and invoking <B
CLASS="COMMAND"
>key <TT
CLASS="PARAMETER"
><I
>2</I
></TT
></B
> again
deselects it.
If no extra argument is given, all subkeys or user IDs are deselected.
Once the user IDs to be deleted are selected, the command
<B
CLASS="COMMAND"
>deluid</B
>
actually deletes the user IDs from your key.
Similarly, the command <B
CLASS="COMMAND"
>delkey</B
>
deletes all selected subkeys from both your public and private keys.</P
><P
>For local keyring management, deleting key components is a good way
to trim other people's public keys of unnecessary material.
Deleting user IDs and subkeys on your own key, however, is not always
wise since it complicates key distribution.
By default, when a user imports your updated public key it will be merged
with the old copy of your public key on his ring if it exists.
The components from both keys are combined in the merge, and this
effectively restores any components you deleted.
To properly update the key, the user must first delete the old version
of your key and then import the new version.
This puts an extra burden on the people with whom you communicate.
Furthermore, if you send your key to a keyserver, the merge will
happen regardless, and anybody who downloads your key from a keyserver
will never see your key with components deleted.
Consequently, for updating your own key it is better to revoke key
components instead of deleting them.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN305"
>Revoking key components</A
></H2
><P
>To revoke a subkey it must be selected.
Once selected it may be revoked with the
<B
CLASS="COMMAND"
>revkey</B
> command.
The key is revoked by adding a revocation self-signature to the key.
Unlike the command-line option <CODE
CLASS="OPTION"
>--gen-revoke</CODE
>, the effect of
revoking a subkey is immediate.</P
><PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>Command></TT
> <KBD
CLASS="USERINPUT"
>revkey</KBD
>
Do you really want to revoke this key? y
You need a passphrase to unlock the secret key for
user: "Chloe (Jester) <chloe@cyb.org>"
1024-bit DSA key, ID B87DBA93, created 1999-06-28
pub 1024D/B87DBA93 created: 1999-06-28 expires: never trust: -/u
sub 2048g/B7934539 created: 1999-06-28 expires: never
sub 1792G/4E3160AD created: 1999-06-29 expires: 2000-06-28
rev! subkey has been revoked: 1999-06-29
sub 960D/E1F56448 created: 1999-06-29 expires: 2000-06-28
(1) Chloe (Jester) <chloe@cyb.org>
(2) Chloe (Plebian) <chloe@tel.net></PRE
><P
>A user ID is revoked differently.
Normally, a user ID collects signatures that attest that the user ID
describes the person who actually owns the associated key.
In theory, a user ID describes a person forever, since that person will
never change.
In practice, though, elements of the user ID such as the email address
and comment may change over time, thus invalidating the user ID.</P
><P
>The OpenPGP
specification does not support user ID revocation, but
a user ID can effectively be revoked by revoking the self-signature
on the user ID.
For the security reasons described
<A
HREF="c236.htm#AEN267"
>previously</A
>,
correspondents will not trust a user ID with no valid self-signature.</P
><P
>A signature is revoked by using the command
<B
CLASS="COMMAND"
>revsig</B
>.
Since you may have signed any number of user IDs, the user interface
prompts you to decide for each signature whether or not to revoke it.</P
><PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>Command></TT
> <KBD
CLASS="USERINPUT"
>revsig</KBD
>
You have signed these user IDs:
Chloe (Jester) <chloe@cyb.org>
signed by B87DBA93 at 1999-06-28
Chloe (Plebian) <chloe@tel.net>
signed by B87DBA93 at 1999-06-28
user ID: "Chloe (Jester) <chloe@cyb.org>"
signed with your key B87DBA93 at 1999-06-28
Create a revocation certificate for this signature? (y/N)n
user ID: "Chloe (Plebian) <chloe@tel.net>"
signed with your key B87DBA93 at 1999-06-28
Create a revocation certificate for this signature? (y/N)y
You are about to revoke these signatures:
Chloe (Plebian) <chloe@tel.net>
signed by B87DBA93 at 1999-06-28
Really create the revocation certificates? (y/N)y
You need a passphrase to unlock the secret key for
user: "Chloe (Jester) <chloe@cyb.org>"
1024-bit DSA key, ID B87DBA93, created 1999-06-28
pub 1024D/B87DBA93 created: 1999-06-28 expires: never trust: -/u
sub 2048g/B7934539 created: 1999-06-28 expires: never
sub 1792G/4E3160AD created: 1999-06-29 expires: 2000-06-28
rev! subkey has been revoked: 1999-06-29
sub 960D/E1F56448 created: 1999-06-29 expires: 2000-06-28
(1) Chloe (Jester) <chloe@cyb.org>
(2) Chloe (Plebian) <chloe@tel.net></PRE
><P
>A revoked user ID is indicated by the revocation signature on
the ID when the signatures on the key's user IDs are listed.</P
><PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>Command></TT
> <KBD
CLASS="USERINPUT"
>check</KBD
>
uid Chloe (Jester) <chloe@cyb.org>
sig! B87DBA93 1999-06-28 [self-signature]
uid Chloe (Plebian) <chloe@tel.net>
rev! B87DBA93 1999-06-29 [revocation]
sig! B87DBA93 1999-06-28 [self-signature]</PRE
><P
>Revoking both subkeys and self-signatures on user IDs adds revocation
self-signatures to the key.
Since signatures are being added and no material is deleted, a
revocation will always be visible to others when your updated public
key is distributed and merged with older copies of it.
Revocation therefore guarantees that everybody has a consistent
copy of your public key.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN329"
>Updating a key's expiration time</A
></H2
><P
>The expiration time of a key may be updated with the command
<B
CLASS="COMMAND"
>expire</B
> from the key edit menu.
If no key is selected the expiration time of the primary key
is updated.
Otherwise the expiration time of the selected subordinate key
is updated.</P
><P
>A key's expiration time is associated with the key's self-signature.
The expiration time is updated by deleting the old self-signature
and adding a new self-signature.
Since correspondents will not have deleted the old self-signature, they
will see an additional self-signature on the key when they update
their copy of your key.
The latest self-signature takes precedence, however, so all correspondents
will unambiguously know the expiration times of your keys.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x216.htm"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x335.htm"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Digital signatures</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
> </TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Validating other keys on your public keyring</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|