xxx-choosing-crypto-in-tor-protocol.txt 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Filename: xxx-choosing-crypto-in-tor-protocol.txt
  2. Title: Picking cryptographic standards in the Tor wire protocol
  3. Author: Marian
  4. Created: 2009-05-16
  5. Status: Draft
  6. Motivation:
  7. SHA-1 is horribly outdated and not suited for security critical
  8. purposes. SHA-2, RIPEMD-160, Whirlpool and Tigerare good options
  9. for a short-term replacement, but in the long run, we will
  10. probably want to upgrade to the winner or a semi-finalist of the
  11. SHA-3 competition.
  12. For a 2006 comparison of different hash algorithms, read:
  13. http://www.sane.nl/sane2006/program/final-papers/R10.pdf
  14. Other reading about SHA-1:
  15. http://www.schneier.com/blog/archives/2005/02/sha1_broken.html
  16. http://www.schneier.com/blog/archives/2005/08/new_cryptanalyt.html
  17. http://www.schneier.com/paper-preimages.html
  18. Additionally, AES has been theoretically broken for years. While
  19. the attack is still not efficient enough that the public sector
  20. has been able to prove that it works, we should probably consider
  21. the time between a theoretical attack and a practical attack as an
  22. opportunity to figure out how to upgrade to a better algorithm,
  23. such as Twofish.
  24. See:
  25. http://schneier.com/crypto-gram-0209.html#1
  26. Design:
  27. I suggest that nodes should publish in directories which
  28. cryptographic standards, such as hash algorithms and ciphers,
  29. they support. Clients communicating with nodes will then
  30. pick whichever of those cryptographic standards they prefer
  31. the most. In the case that the node does not publish which
  32. cryptographic standards it supports, the client should assume
  33. that the server supports the older standards, such as SHA-1
  34. and AES, until such time as we choose to desupport those
  35. standards.
  36. Node to node communications could work similarly. However, in
  37. case they both support a set of algorithms but have different
  38. preferences, the disagreement would have to be resolved
  39. somehow. Two possibilities include:
  40. * the node requesting communications presents which
  41. cryptographic standards it supports in the request. The
  42. other node picks.
  43. * both nodes send each other lists of what they support and
  44. what version of Tor they are using. The newer node picks,
  45. based on the assumption that the newer node has the most up
  46. to date information about which hash algorithm is the best.
  47. Of course, the node could lie about its version, but then
  48. again, it could also maliciously choose only to support older
  49. algorithms.
  50. Using this method, we could potentially add server side support
  51. to hash algorithms and ciphers before we instruct clients to
  52. begin preferring those hash algorithms and ciphers. In this way,
  53. the clients could upgrade and the servers would already support
  54. the newly preferred hash algorithms and ciphers, even if the
  55. servers were still using older versions of Tor, so long as the
  56. older versions of Tor were at least new enough to have server
  57. side support.
  58. This would make quickly upgrading to new hash algorithms and
  59. ciphers easier. This could be very useful when new attacks
  60. are published.
  61. One concern is that client preferences could expose the client
  62. to segmentation attacks. To mitigate this, we suggest hardcoding
  63. preferences in the client, to prevent the client from choosing
  64. to use a new hash algorithm or cipher that no one else is using
  65. yet. While offering a preference might be useful in case a client
  66. with an older version of Tor wants to start using the newer hash
  67. algorithm or cipher that everyone else is using, if the client
  68. cares enough, he or she can just upgrade Tor.
  69. We may also have to worry about nodes which, through laziness or
  70. maliciousness, refuse to start supporting new hash algorithms or
  71. ciphers. This must be balanced with the need to maintain
  72. backward compatibility so the client will have a large selection
  73. of nodes to pick from. Adding new hash algorithms and ciphers
  74. long before we suggest nodes start using them can help mitigate
  75. this. However, eventually, once sufficient nodes support new
  76. standards, client side support for older standards should be
  77. disabled, particularly if there are practical rather than merely
  78. theoretical attacks.
  79. Server side support for older standards can be kept much longer
  80. than client side support, since clients using older hashes and
  81. ciphers are really only hurting theirselvse.
  82. If server side support for a hash algorithm or cipher is added
  83. but never preferred before we decide we don't really want it,
  84. support can be removed without having to worry about backward
  85. compatibility.
  86. Security implications:
  87. Improving cryptography will improve Tor's security. However, if
  88. clients pick different cryptographic standards, they could be
  89. partitioned based on their cryptographic preferences. We also
  90. need to worry about nodes refusing to support new standards.
  91. These issues are detailed above.
  92. Specification:
  93. Todo. Need better understanding of how Tor currently works or
  94. help from someone who does.
  95. Compatibility:
  96. This idea is intended to allow easier upgrading of cryptographic
  97. hash algorithms and ciphers while maintaining backwards
  98. compatibility. However, at some point, backwards compatibility
  99. with very old hashes and ciphers should be dropped for security
  100. reasons.
  101. Implementation:
  102. Todo.
  103. Performance and scalability nodes:
  104. Better hashes and cipher are someimes a little more CPU intensive
  105. than weaker ones. For instance, on most computers AES is a little
  106. faster than Twofish. However, in that example, I consider Twofish's
  107. additional security worth the tradeoff.
  108. Acknowledgements:
  109. Discussed this on IRC with a few people, mostly Nick Mathewson.
  110. Nick was particularly helpful in explaining how Tor works,
  111. explaining goals, and providing various links to Tor
  112. specifications.