103-multilevel-keys.txt 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. Filename: 103-multilevel-keys.txt
  2. Title: Splitting identity key from regularly used signing key.
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Nick Mathewson
  6. Created:
  7. Status: Open
  8. Overview:
  9. This document proposes a change in the way identity keys are used, so that
  10. highly sensitive keys can be password-protected and seldom loaded into RAM.
  11. It presents options; it is not yet a complete proposal.
  12. Proposal:
  13. Replacing a directory authority's identity key in the event of a compromise
  14. would be tremendously annoying. We'd need to tell every client to switch
  15. their configuration, or update to a new version with an uploaded list. So
  16. long as some weren't upgraded, they'd be at risk from whoever had
  17. compromised the key.
  18. With this in mind, it's a shame that our current protocol forces us to
  19. store identity keys unencrypted in RAM. We need some kind of signing key
  20. stored unencrypted, since we need to generate new descriptors/directories
  21. and rotate link and onion keys regularly. (And since, of course, we can't
  22. ask server operators to be on-hand to enter a passphrase every time we
  23. want to rotate keys or sign a descriptor.)
  24. The obvious solution seems to be to have a signing-only key that lives
  25. indefinitely (months or longer) and signs descriptors and link keys, and a
  26. separate identity key that's used to sign the signing key. Tor servers
  27. could run in one of several modes:
  28. 1. Identity key stored encrypted. You need to pick a passphrase when
  29. you enable this mode, and re-enter this passphrase every time you
  30. rotate the signing key.
  31. 1'. Identity key stored separate. You save your identity key to a
  32. floppy, and use the floppy when you need to rotate the signing key.
  33. 2. All keys stored unencrypted. In this case, we might not want to even
  34. *have* a separate signing key. (We'll need to support no-separate-
  35. signing-key mode anyway to keep old servers working.)
  36. 3. All keys stored encrypted. You need to enter a passphrase to start
  37. Tor.
  38. (Of course, we might not want to implement all of these.)
  39. Case 1 is probably most usable and secure, if we assume that people don't
  40. forget their passphrases or lose their floppies. We could mitigate this a
  41. bit by encouraging people to PGP-encrypt their passphrases to themselves,
  42. or keep a cleartext copy of their secret key secret-split into a few
  43. pieces, or something like that.
  44. Migration presents another difficulty, especially with the authorities. If
  45. we use the current set of identity keys as the new identity keys, we're in
  46. the position of having sensitive keys that have been stored on
  47. media-of-dubious-encryption up to now. Also, we need to keep old clients
  48. (who will expect descriptors to be signed by the identity keys they know
  49. and love, and who will not understand signing keys) happy.
  50. A possible solution:
  51. One thing to consider is that router identity keys are not very sensitive:
  52. if an OR disappears and reappears with a new key, the network treats it as
  53. though an old router had disappeared and a new one had joined the network.
  54. The Tor network continues unharmed; this isn't a disaster.
  55. Thus, the ideas above are mostly relevant for authorities.
  56. The most straightforward solution for the authorities is probably to take
  57. advantage of the protocol transition that will come with proposal 101, and
  58. introduce a new set of signing _and_ identity keys used only to sign votes
  59. and consensus network-status documents. Signing and identity keys could be
  60. delivered to users in a separate, rarely changing "keys" document, so that
  61. the consensus network-status documents wouldn't need to include N signing
  62. keys, N identity keys, and N certifications.
  63. Note also that there is no reason that the identity/signing keys used by
  64. directory authorities would necessarily have to be the same as the identity
  65. keys those authorities use in their capacity as routers. Decoupling these
  66. keys would give directory authorities the following set of keys:
  67. Directory authority identity:
  68. Highly confidential; stored encrypted and/or offline. Used to
  69. identity directory authorities. Shipped with clients. Used to
  70. sign Directory authority signing keys.
  71. Directory authority signing key:
  72. Stored online, accessible to regular Tor process. Used to sign
  73. votes and consensus directories. Downloaded as part of a "keys"
  74. document.
  75. [Administrators SHOULD rotate their signing keys every month or
  76. two, just to keep in practice and keep from forgetting the
  77. password to the authority identity.]
  78. V1-V2 directory authority identity:
  79. Stored online, never changed. Used to sign legacy network-status
  80. and directory documents.
  81. Router identity:
  82. Stored online, seldom changed. Used to sign server descriptors
  83. for this authority in its role as a router. Implicitly certified
  84. by being listed in network-status documents.
  85. Onion key, link key:
  86. As in tor-spec.txt
  87. Extensions to Proposal 101.
  88. Define a new document type, "Key certificate". It contains the
  89. following fields, in order:
  90. "dir-key-certificate-version": As network-status-version. Must be
  91. "3".
  92. "fingerprint": Hex fingerprint, with spaces, based on the directory
  93. authority's identity key.
  94. "dir-identity-key": The long-term identity key for this authority.
  95. "dir-key-published": The time when this directory's signing key was
  96. last changed.
  97. "dir-key-expires": A time after which this key is no longer valid.
  98. "dir-signing-key": As in proposal 101.
  99. "dir-key-certification": A signature of the above fields, in order.
  100. The signed material extends from the beginning of
  101. "dir-key-certicate-version" through the newline after
  102. "dir-key-certification". The identity key is used to generate
  103. this signature.
  104. These elements together constitute a "key certificate". These are
  105. generated offline when starting a v3 authority. Private identity
  106. keys SHOULD be stored offline, encrypted, or both. A running
  107. authority only needs access to the signing key.
  108. Unlike other keys currently used by Tor, the authority identity
  109. keys and directory signing keys MAY be longer than 1024 bits.
  110. (They SHOULD be 2048 bits or longer; they MUST NOT be shorter than
  111. 1024.)
  112. Vote documents change as follows:
  113. A key certificate MUST be included in-line in every vote document. With
  114. the exception of "fingerprint", its elements MUST NOT appear in consensus
  115. documents.
  116. Consensus network statuses change as follows:
  117. Remove dir-signing-key.
  118. Change "directory-signature" to take a fingerprint of the authority's
  119. identity key and a fingerprint of the authority's current signing key
  120. rather than the authority's nickname.
  121. Change "dir-source" to take the a fingerprint of the authority's
  122. identity key rather than the authority's nickname or hostname.
  123. Add a new document type:
  124. A "keys" document contains all currently known key certificates.
  125. All authorities serve it at
  126. http://<hostname>/tor/status/keys.z
  127. Caches and clients download the keys document whenever they receive a
  128. consensus vote that uses a key they do not recognize. Caches download
  129. from authorities; clients download from caches.
  130. Processing votes:
  131. When receiving a vote, authorities check to see if the key
  132. certificate for the voter is different from the one they have. If
  133. the key certificate _is_ different, and its dir-key-published is
  134. more recent than the most recently known one, and it is
  135. well-formed and correctly signed with the correct identity key,
  136. then authorities remember it as the new canonical key certificate
  137. for that voter.
  138. A key certificate is invalid if any of the following hold:
  139. * The version is unrecognized.
  140. * The fingerprint does not match the identity key.
  141. * The identity key or the signing key is ill-formed.
  142. * The published date is very far in the past or future.
  143. * The signature is not a valid signature of the key certificate
  144. generated with the identity key.
  145. When processing the signatures on consensus, clients and caches act as
  146. follows:
  147. 1. Only consider the directory-signature entries whose identity
  148. key hashes match trusted authorities.
  149. 2. If any such entries have signing key hashes that match unknown
  150. signing keys, download a new keys document.
  151. 3. For every entry with a known (identity key,signing key) pair,
  152. check the signature on the document.
  153. 4. If the document has been signed by more than half of the
  154. authorities the client recognizes, treat the consensus as
  155. correctly signed.
  156. If not, but the number entries with known identity keys but
  157. unknown signing keys might be enough to make the consensus
  158. correctly signed, do not use the consensus, but do not discard
  159. it until we have a new keys document.