103-multilevel-keys.txt 9.0 KB

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