idnits 2.17.1 draft-roughtime-aanchal-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Introduction section. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 8, 2019) is 1903 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'RFC5280' is defined on line 368, but no explicit reference was found in the text == Outdated reference: A later version (-28) exists of draft-ietf-ntp-using-nts-for-ntp-16 Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force A. Malhotra 3 Internet-Draft Boston University 4 Intended status: Informational A. Langly 5 Expires: August 12, 2019 Google 6 W. Ladd 7 Cloudflare 8 February 8, 2019 10 Roughtime 11 draft-roughtime-aanchal-00 13 Abstract 15 This document specifies Roughtime - a protocol that aims to achieve 16 rough time synchronization while detecting servers that provide 17 inaccurate time and providing cryptographic proof of their 18 malfeasance. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on August 12, 2019. 37 Copyright Notice 39 Copyright (c) 2019 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 1. Motivation 54 Time synchronization is essential to Internet security as many 55 security protocols and other applications require synchronization 56 [RFC7384][MCBG]. Unfortunately widely deployed protocols such as the 57 Network Time Protocol (NTP) [RFC5905] lack essential security 58 features, and even newer protocols like Network Time Security (NTS) 59 [I-D.ietf-ntp-using-nts-for-ntp] fail to ensure that the servers 60 behave correctly. Authenticating time servers prevents network 61 adversaries from modifying time packets. An authenticated time 62 server still has full control over the contents of time packet and 63 may go rogue. Roughtime protocol provides cryptographic proof of 64 malfeasance, enabling clients to detect and prove to a third party 65 server's attempts to influence the time a client computes. 67 +--------------+----------------------+-----------------------------+ 68 | Protocol | Authenticated Server | Server Malfeasance Evidence | 69 +--------------+----------------------+-----------------------------+ 70 | NTP, Chronos | N | N | 71 | NTP-MD5 | Y* | N | 72 | NTP-Autokey | Y** | N | 73 | NTS | Y | N | 74 | Roughtime | Y | Y | 75 +--------------+----------------------+-----------------------------+ 77 Security Properties of current protocols 79 Table 1 81 Y* For security issues with symmetric-key based NTP-MD5 82 authentication, please refer to Message Authentication Code for the 83 Network Time Protocol draft [I-D.ietf-ntp-mac] 85 Y** For security issues with Autokey Public Key Authentication, refer 86 to [Autokey] 88 2. Requirements Language 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 92 "OPTIONAL" in this document are to be interpreted as described in BCP 93 14 [RFC2119] [RFC8174] when, and only when, they appear in all 94 capitals, as shown here. 96 3. Protocol Overview 98 Roughtime is a protocol for rough time synchronization that enables 99 clients to provide cryptographic proof of server malfeasance. It 100 does so by having responses from servers include a signature with a 101 certificate rooted in long term public/private key pair over a 102 portion of the initial request, thus providing cryptographic proof 103 that the timestamp was issued after previous responses and before 104 future ones. 106 Single server mode: At its most basic level, Roughtime is a one round 107 protocol in which a completely fresh client requests the current time 108 and the server sends a signed response. The response inculdes a 109 timestamp (the number of microseconds since the Unix epoch) and a 110 radius (in microseconds) used to indicate the servers certainty about 111 the reported time. For example, a radius of 1,000,000 microseconds 112 means the server is absolutely confident that the true time is within 113 one second of the reported time. 115 The server proves freshness of its response as follows: The request 116 contains a random challenge. The server incorporates the challenge 117 into its signed response so that its needed to verify the signature. 118 This proves that the signed response could only have been generated 119 after the challenge was issued if the challenge has sufficient 120 entropy. 122 Chaining multiple servers: For subsequent requests, the client 123 generates its nonce by hashing the reply from the first server with a 124 random value. This proves that the nonce was created after the reply 125 from the first server. It sends that to the second server and 126 receives a signature from it covering that nonce and the time from 127 the second server. 129 Cryptographic proof of misbehavior: If the time from the second 130 server is before the first, then the client has proof of misbehavior; 131 the reply from the second server implicitly shows that it was created 132 later because of the way that the client constructed the nonce. If 133 the time from the second server is after, then the client can contact 134 the first server again and get a signature that was provably created 135 afterwards, but with an earlier timestamp. 137 With only two servers, the client can end up with proof that 138 something is wrong, but no idea what the correct time is. But with 139 half a dozen or more independent servers, the client will end up with 140 chain of proof of any servers misbehavior, signed by several others, 141 and (presumably) enough accurate replies to establish what the 142 correct time is. Furthermore this proof may be validated by third 143 parties ultimately leading to a revocation of trust in the 144 misbehaving server. 146 4. Message Format 148 A Roughtime packet is a UDP packet whose contents are interpreted as 149 a map from uint32s to strings of bytes. The byte strings must all 150 have lengths a multiple of four. All uint32 are encoded with the 151 least significant byte first. The keys of this map are called tags, 152 and we speak of the value of a tag as the string of bytes it is 153 mapped to. 155 A Roughtime packet is serialized as follows: First there is a header, 156 The first four bytes in the header are the uint32 number of tags N, 157 and hence of (tag, value) pairs. 4*(N-1) bytes are offsets, each 158 offset a uint32. The last 4*N bytes are the tags. 160 Tags are in ascending order, and no tag can be repeated. Offsets are 161 all a multiple of four and MUST be strictly increasing. The offset 162 array is considered to have a not explicitly encoded value of 0 as 163 its zeroeth entry. 165 Immediately following the header is a concatenation of all the 166 strings. The first post-header byte is at offset 0, and the end of 167 the final byte string is indicated by the end of the packet. The ith 168 byte string ends at offset[i+1]-1, counting of course from 0, and 169 begins at offset[i]. It is the value associated to the ith tag. 171 This encoding may be recursive: a value may be said to be in 172 Roughtime format and thus have a header, etc. Tags may be listed as 173 four ASCII characters [RFC0020]. In this case the tag when 174 serialized will be those four ASCII characters. Exempli gratia NONC 175 would be the numeric value 0x434e4f4e. They may also be listed as 176 fewer then four ASCII characters with hex escape codes at the end. 178 5. Protocol 180 5.1. Queries 182 A query is a Roughtime packet with the tag NONC. The contents of 183 NONC are 64 bytes. The request packet MUST be a minimum of 1024 184 bytes. To attain this size the tag PAD\xff MAY be added at the end 185 of the packet with a conent of all zeros. Other tags MUST be ignored 186 by the server. Future versions may specify additional tags and their 187 semantics, so clients MUST NOT add other tags. 189 5.2. Responses 191 A response contains the following tags: SREP, SIG\x00, CERT, INDX, 192 PATH, SREP value is itself in Roughtime format that contains the 193 folowing tags: ROOT, MIDP, RADI. SIG\x00 is an Ed25519 signature 194 [RFC8032] over the SREP value using the public key contained in CERT 195 as explained later. 197 CERT in Roughtime format and contains the following tags: DELE, 198 SIG\x00. This SIG\x00 is an Ed25519 signature over DELE using the 199 long term public key of the server. DELE is itself in Roughtime 200 format containing tags MINT, MAXT, PUBK. 202 5.2.1. SREP 204 ROOT contains the root hash value of a Merkle tree using SHA512 as 205 described when we reach the PATH and INDX blocks MIDP contains an 206 uint64 value consisting of the number of microseconds since the Unix 207 epoch in the smeared scale. RADI contains the server's estimate of 208 the accuracy of MIDP. Servers MUST ensure the true time is within 209 (MIDP-RADI, MIDP+RADI) at the time they compose the response packet. 211 5.2.2. DELE 213 MINT is the minimum uint64 timestamp at which the key in PUBK is 214 trusted to begin signing time. MIDP > MINT for validity. MAXT is 215 the maximum uint64 timestamp at which PUBK may sign. MIDP < MAXT for 216 validity. PUBK is a temporary Ed25519 public key. The use of this 217 field is to enable seperation of a root public key from keys on 218 devices exposed to the public Internet. 220 5.2.3. INDX and PATH 222 INDX is a uint32 determining the position of NONC in a Merkle tree. 223 PATH determines the values to be hashed with the running hash as one 224 ascends the tree. The final value MUST be equal to ROOT. PATH is a 225 multiple of 64 bytes long. One starts by computing the hash of the 226 NONC value from the request, with \x00 preappended. Then one walks 227 from the least significant bit of INDX to the most significant bit, 228 and also walks towards the end of PATH. If PATH ends then the 229 remaining bits of the INDX MUST be all zero. This indicates the 230 termination of the walk. If the current bit is 0, one hashes \x01, 231 the current hash, and the value from PATH. If the current bit is 1 232 one hashes \x01, the value from PATH, and the current HASH. This 233 enables servers to batch signing when busy. 235 5.3. Validity of response 237 A client MUST check the following properties when it receives a 238 response. We assume the long term server public key is known to the 239 client through other means. 241 The signature in CERT was made with the long-term key of the 242 server 244 The DELE timestamps and the MIDP value are consistent 246 The INDX and PATH values prove NONC was included in the Merkle 247 tree with value ROOT 249 The signature of SREP in SIG\x00 validates with the public key in 250 DELE 252 A response that passes these checks is said to be valid. Validity of 253 a response does not prove the time is correct, but merely that the 254 server signed it, and more specifically began to compute the 255 signature at a time in between (MIDP-RADI, MIDP+RADI). 257 6. The smeared scale 259 Every day in Roughtime has 86400 seconds. A day without a leap 260 second is a day where all seconds are SI seconds. A day with a 261 positive leap second is one where every second is 86401/86400 SI 262 seconds long. A day with a negative leap second is a day where every 263 second is 86399/86400 SI seconds long. Days begin and end at noon, 264 and when a leap-second is added or removed from UTC it is smeared out 265 over the course of a day. 267 Arithemtic on the smeared scale requires knowing when the seconds 268 changed length and thus requires a leap second table. 270 7. Cheater detection 272 A chain of responses is a series of responses where the SHA-512 hash 273 of the preceding response H, is concatenated with a 64 bit blind X, 274 and then SHA-512(H, X) is the NONC used in the subsequent response. 275 These may be represented in JSON as TBD 277 A pair of responses (r_1, r_2) is invalid if MIDP_1-RADI_1 > 278 MIDP_2+RADI_2. A chain of longer length is invalid if for any i, j 279 such that i < j, (r_i, r_j) is an invalid pair. 281 Invalidity of a chain is proof that causality has been violated if 282 all servers were reporting correct time. An invalid chain where all 283 individual responses are valid is cryptographic proof of malfeasance 284 of at least one server: if all servers had the correct time in the 285 chain, causality would imply that MIDP_1-RADI_1 < MIDP_2+RADI_2. 287 8. Grease 289 Servers MAY send back a fraction of responses that are syntactically 290 invalid or contain invalid signatures as well as incorrect times. 291 Clients MUST properly reject such responses. 293 9. Roughtime Servers 295 The below list contains a list of servers with their public keys in 296 either Base64 or hexidecimal format. 298 roughtime.int08h.com:2002; 299 016e6e0284d24c37c6e4d7d8d5b4e1d3c1949ceaa545bf875616c9dce0 301 roughtime.cloudflare.com:2002; gD63hSj3ScS+wuOeGrubXlq35N1c5Lby/ 302 S+T7MNTjxo= 304 roughtime.sandbox.google.com:2002; 305 etPaaIxcBMY1oUeGpwvPMCJMwlRVNxv51KK/tktoJTQ= 307 10. Acknowledgements 309 TBD 311 11. IANA Considerations 313 This memo includes no request to IANA. 315 12. Security Considerations 317 This protocol will not survive the advent of quantum computers. 318 Currently only one signature scheme is supported. Maintaining a list 319 of trusted servers and adjudicating violations of the rules by 320 servers are not discussed in this document and are essential for 321 security. Arithmetic on the adjusted timescale is interesting with 322 intervals, and this may impact the interpretation of the MAXT and 323 MINT fields. Servers carry out a significant amount of computation 324 in response to clients, and thus may experience vulnerability to 325 denial of service attacks. 327 This protocol does not provide any confidentiality, and given the 328 nature of timestamps such impact is minor. The compromise of a 329 PUBK's private key, even past MAXT, is a problem as the private key 330 can be used to sign invalid times that are in the range MINT to MAXT, 331 and thus violate the good behavior guarantee of the server. 333 13. Privacy Considerations 335 This protocol is designed to obscure all client identifiers. Servers 336 necessarily have persistent long term identities essential to 337 enforcing correct behavior. 339 14. Informative References 341 [Autokey] Rottger, S., "Analysis of the NTP Autokey Procedures", 342 2012, . 344 [I-D.ietf-ntp-mac] 345 Malhotra, A. and S. Goldberg, "Message Authentication Code 346 for the Network Time Protocol", draft-ietf-ntp-mac-06 347 (work in progress), January 2019. 349 [I-D.ietf-ntp-using-nts-for-ntp] 350 Franke, D., Sibold, D., Teichel, K., Dansarie, M., and R. 351 Sundblad, "Network Time Security for the Network Time 352 Protocol", draft-ietf-ntp-using-nts-for-ntp-16 (work in 353 progress), February 2019. 355 [MCBG] Malhotra, A., Cohen, I., Brakke, E., and S. Goldberg, 356 "Attacking the Network Time Protocol", 2015, 357 . 359 [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, 360 RFC 20, DOI 10.17487/RFC0020, October 1969, 361 . 363 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 364 Requirement Levels", BCP 14, RFC 2119, 365 DOI 10.17487/RFC2119, March 1997, 366 . 368 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 369 Housley, R., and W. Polk, "Internet X.509 Public Key 370 Infrastructure Certificate and Certificate Revocation List 371 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 372 . 374 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 375 "Network Time Protocol Version 4: Protocol and Algorithms 376 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 377 . 379 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 380 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 381 October 2014, . 383 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 384 Signature Algorithm (EdDSA)", RFC 8032, 385 DOI 10.17487/RFC8032, January 2017, 386 . 388 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 389 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 390 May 2017, . 392 Authors' Addresses 394 Aanchal Malhotra 395 Boston University 396 111 Cummington Mall 397 Boston 02215 398 USA 400 Email: aanchal4@bu.edu 402 Adam Langly 403 Google 405 Watson Ladd 406 Cloudflare 407 101 Townsend St 408 San Francisco 409 USA 411 Email: watson@cloudflare.com