idnits 2.17.00 (12 Aug 2021) /tmp/idnits54332/draft-vcelak-nsec5-02.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 21, 2016) is 2251 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 5114 ** Downref: Normative reference to an Informational RFC: RFC 6234 ** Downref: Normative reference to an Informational RFC: RFC 7748 -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-186-3' -- Possible downref: Non-RFC (?) normative reference: ref. 'SECG1' Summary: 4 errors (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Vcelak 3 Internet-Draft CZ.NIC 4 Intended status: Standards Track S. Goldberg 5 Expires: September 22, 2016 D. Papadopoulos 6 Boston University 7 March 21, 2016 9 NSEC5, DNSSEC Authenticated Denial of Existence 10 draft-vcelak-nsec5-02 12 Abstract 14 The Domain Name System Security (DNSSEC) Extensions introduced the 15 NSEC resource record (RR) for authenticated denial of existence and 16 the NSEC3 for hashed authenticated denial of existence. The NSEC RR 17 allows for the entire zone contents to be enumerated if a server is 18 queried for carefully chosen domain names; N queries suffice to 19 enumerate a zone containing N names. The NSEC3 RR adds domain-name 20 hashing, which makes the zone enumeration harder, but not impossible. 21 This document introduces NSEC5, which provides an cryptographically- 22 proven mechanism that prevents zone enumeration. NSEC5 has the 23 additional advantage of not requiring private zone-signing keys to be 24 present on all authoritative servers for the zone. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on September 22, 2016. 43 Copyright Notice 45 Copyright (c) 2016 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 61 1.1. Rationale . . . . . . . . . . . . . . . . . . . . . . . . 3 62 1.2. Requirements . . . . . . . . . . . . . . . . . . . . . . 5 63 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 64 2. Backward Compatibility . . . . . . . . . . . . . . . . . . . 5 65 3. How NSEC5 Works . . . . . . . . . . . . . . . . . . . . . . . 6 66 4. NSEC5 Algorithms . . . . . . . . . . . . . . . . . . . . . . 7 67 5. The NSEC5KEY Resource Record . . . . . . . . . . . . . . . . 8 68 5.1. NSEC5KEY RDATA Wire Format . . . . . . . . . . . . . . . 8 69 5.2. NSEC5KEY RDATA Presentation Format . . . . . . . . . . . 8 70 6. The NSEC5 Resource Record . . . . . . . . . . . . . . . . . . 8 71 6.1. NSEC5 RDATA Wire Format . . . . . . . . . . . . . . . . . 9 72 6.2. NSEC5 Flags Field . . . . . . . . . . . . . . . . . . . . 9 73 6.3. NSEC5 RDATA Presentation Format . . . . . . . . . . . . . 10 74 7. The NSEC5PROOF Resource Record . . . . . . . . . . . . . . . 10 75 7.1. NSEC5PROOF RDATA Wire Format . . . . . . . . . . . . . . 10 76 7.2. NSEC5PROOF RDATA Presentation Format . . . . . . . . . . 11 77 8. NSEC5 Proofs . . . . . . . . . . . . . . . . . . . . . . . . 11 78 8.1. Name Error Responses . . . . . . . . . . . . . . . . . . 11 79 8.2. No Data Responses . . . . . . . . . . . . . . . . . . . . 12 80 8.2.1. No Data Response, Opt-Out Not In Effect . . . . . . . 12 81 8.2.2. No Data Response, Opt-Out In Effect . . . . . . . . . 13 82 8.3. Wildcard Responses . . . . . . . . . . . . . . . . . . . 13 83 8.4. Wildcard No Data Responses . . . . . . . . . . . . . . . 13 84 9. Authoritative Server Considerations . . . . . . . . . . . . . 14 85 9.1. Zone Signing . . . . . . . . . . . . . . . . . . . . . . 14 86 9.2. Zone Serving . . . . . . . . . . . . . . . . . . . . . . 15 87 9.3. NSEC5KEY Rollover Mechanism . . . . . . . . . . . . . . . 16 88 9.4. Secondary Servers . . . . . . . . . . . . . . . . . . . . 17 89 9.5. Zones Using Unknown Hash Algorithms . . . . . . . . . . . 17 90 9.6. Dynamic Updates . . . . . . . . . . . . . . . . . . . . . 17 91 10. Resolver Considerations . . . . . . . . . . . . . . . . . . . 17 92 11. Validator Considerations . . . . . . . . . . . . . . . . . . 17 93 11.1. Validating Responses . . . . . . . . . . . . . . . . . . 18 94 11.2. Validating Referrals to Unsigned Subzones . . . . . . . 19 95 11.3. Responses With Unknown Hash Algorithms . . . . . . . . . 19 97 12. Special Considerations . . . . . . . . . . . . . . . . . . . 19 98 12.1. Transition Mechanism . . . . . . . . . . . . . . . . . . 19 99 12.2. NSEC5 Private Keys . . . . . . . . . . . . . . . . . . . 19 100 12.3. Domain Name Length Restrictions . . . . . . . . . . . . 20 101 13. Performance Considerations . . . . . . . . . . . . . . . . . 20 102 13.1. Performance of Cryptographic Operations . . . . . . . . 20 103 13.1.1. NSEC3 Hashing Performance . . . . . . . . . . . . . 20 104 13.1.2. NSEC5 Hashing Performance . . . . . . . . . . . . . 21 105 13.1.3. DNSSEC Signing Performance . . . . . . . . . . . . . 21 106 13.2. Authoritative Server Startup . . . . . . . . . . . . . . 22 107 13.3. NSEC5 Answer Generating and Processing . . . . . . . . . 23 108 13.4. Response Lengths . . . . . . . . . . . . . . . . . . . . 23 109 13.5. Summary . . . . . . . . . . . . . . . . . . . . . . . . 24 110 14. Security Considerations . . . . . . . . . . . . . . . . . . . 25 111 14.1. Zone Enumeration Attacks . . . . . . . . . . . . . . . . 25 112 14.2. Hash Collisions . . . . . . . . . . . . . . . . . . . . 25 113 14.3. Compromise of the Private NSEC5 Key . . . . . . . . . . 26 114 14.4. Key Length Considerations . . . . . . . . . . . . . . . 26 115 14.5. Transitioning to a New NSEC5 Algorithm . . . . . . . . . 26 116 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 117 16. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 27 118 17. References . . . . . . . . . . . . . . . . . . . . . . . . . 28 119 17.1. Normative References . . . . . . . . . . . . . . . . . . 28 120 17.2. Informative References . . . . . . . . . . . . . . . . . 30 121 Appendix A. RSA Full Domain Hash Algorithm . . . . . . . . . . . 31 122 A.1. FDH signature . . . . . . . . . . . . . . . . . . . . . . 31 123 A.2. FDH verification . . . . . . . . . . . . . . . . . . . . 32 124 Appendix B. Elliptic Curve VRF . . . . . . . . . . . . . . . . . 32 125 B.1. ECVRF Hash To Curve . . . . . . . . . . . . . . . . . . . 33 126 B.2. ECVRF Auxiliary Functions . . . . . . . . . . . . . . . . 34 127 B.2.1. ECVRF Hash Points . . . . . . . . . . . . . . . . . . 34 128 B.2.2. ECVRF Proof To Hash . . . . . . . . . . . . . . . . . 35 129 B.2.3. ECVRF Decode Proof . . . . . . . . . . . . . . . . . 35 130 B.3. ECVRF Signing . . . . . . . . . . . . . . . . . . . . . . 36 131 B.4. ECVRF Verification . . . . . . . . . . . . . . . . . . . 36 132 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 37 133 Appendix D. Open Issues . . . . . . . . . . . . . . . . . . . . 38 134 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38 136 1. Introduction 138 1.1. Rationale 140 The DNS Security Extensions (DNSSEC) provides data integrity 141 protection using public-key cryptography, while not requiring that 142 authoritative servers compute signatures on-the-fly. The content of 143 the zone is usually pre-computed and served as is. The evident 144 advantages of this approach are reduced performance requirements per 145 query, as well as not requiring private zone-signing keys to be 146 present on nameservers facing the network. 148 With DNSSEC, each resource record (RR) set in the zone is signed. 149 The signature is retained as an RRSIG RR directly in the zone. This 150 enables response authentication for data existing in the zone. To 151 ensure integrity of denying answers, an NSEC chain of all existing 152 domain names in the zone is constructed. The chain is made of RRs, 153 where each RR represents two consecutive domain names in canonical 154 order present in the zone. The NSEC RRs are signed the same way as 155 any other RRs in the zone. Non-existence of a name can be thus 156 proven by presenting a NSEC RR which covers the name. 158 As side-effect, however, the NSEC chain allows for enumeration of the 159 zone's contents by sequentially querying for the names immediately 160 following those in the most-recently retrieved NSEC record; N queries 161 suffice to enumerate a zone containing N names. As such, the NSEC3 162 hashed denial of existence was introduced to prevent zone 163 enumeration. In NSEC3, the original domain names in the NSEC chain 164 are replaced by their cryptographic hashes. While NSEC3 makes zone 165 enumeration more difficult, offline dictionary attacks are still 166 possible and have been demonstrated; this is because hashes may be 167 computed offline and the space of possible domain names is restricted 168 [nsec3walker][nsec3gpu]. 170 Zone enumeration can be prevented with NSEC3 if having the 171 authoritative server compute NSEC3 RRs on-the-fly, in response to 172 queries with denying responses. Usually, this is done with Minimally 173 Covering NSEC Records or NSEC3 White Lies [RFC7129]. The 174 disadvantage of this approach is a required presence of the private 175 key on all authoritative servers for the zone. This is often 176 undesirable, as the holder of the private key can tamper with the 177 zone contents, and having private keys on many network-facing servers 178 increases the risk that keys can be compromised. 180 To prevent zone content enumeration without keeping private keys on 181 all authoritative servers, NSEC5 replaces the unkeyed cryptographic 182 hash function used in NSEC3 with a public-key hashing scheme. 183 Hashing in NSEC5 is performed with a separate NSEC5 key. The public 184 portion of this key is distributed in an NSEC5KEY RR, and is used to 185 validate NSEC5 hash values. The private portion of the NSEC5 key is 186 present on all authoritative servers for the zone, and is used to 187 compute hash values. 189 Importantly, the NSEC5KEY key cannot be used to modify the contents 190 of the zone. Thus, any compromise of the private NSEC5 key does not 191 lead to a compromise of zone contents. All that is lost is privacy 192 against zone enumeration, effectively downgrading the security of 193 NSEC5 to that of NSEC3. NSEC5 comes with a cryptographic proof of 194 security, available in [nsec5]. 196 The NSEC5 is not intended to replace NSEC or NSEC3. It is designed 197 as an alternative mechanism for authenticated denial of existence. 199 1.2. Requirements 201 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 202 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 203 document are to be interpreted as described in [RFC2119]. 205 1.3. Terminology 207 The reader is assumed to be familiar with the basic DNS and DNSSEC 208 concepts described in [RFC1034], [RFC1035], [RFC4033], [RFC4034], 209 [RFC4035], and subsequent RFCs that update them: [RFC2136], 210 [RFC2181], [RFC2308], and [RFC5155]. 212 The following terminology is used through this document: 214 Base32hex: The "Base 32 Encoding with Extended Hex Alphabet" as 215 specified in [RFC4648]. The padding characters ("=") are not used 216 in NSEC5 specification. 218 Base64: The "Base 64 Encoding" as specified in [RFC4648]. 220 NSEC5 proof: A signed hash of a domain name (hash-and-sign 221 paradigm). A holder of the private key (e.g., authoritative 222 server) can compute the proof. Anyone knowing the public key 223 (e.g., client) can verify it's validity. 225 NSEC5 hash: A cryptographic hash (digest) of an NSEC5 proof. If the 226 NSEC5 proof is known, anyone can compute and verify it's NSEC5 227 hash. 229 NSEC5 algorithm: A pair of algorithms used to compute NSEC5 proofs 230 and NSEC5 hashes. 232 2. Backward Compatibility 234 The specification describes a protocol change that is not backward 235 compatible with [RFC4035] and [RFC5155]. NSEC5-unaware resolver will 236 fail to validate responses introduced by this document. 238 To prevent NSEC5-unaware resolvers from attempting to validate the 239 responses, new DNSSEC algorithms identifiers are introduced, the 240 identifiers alias with existing algorithm numbers. The zones signed 241 according to this specification MUST use only these algorithm 242 identifiers, thus NSEC5-unaware resolvers will treat the zone as 243 insecure. 245 The new algorithm identifiers defined by this document are listed in 246 Section 15. 248 3. How NSEC5 Works 250 To prove non-existence of a domain name in a zone, NSEC uses a chain 251 built from domain names present in the zone. NSEC3 replaces the 252 original domain names by their cryptographic hashes. NSEC5 is very 253 similar to NSEC3, except that the cryptographic hash is replaced by 254 hashes computed using a verifiable random function (VRF). A VRF is 255 essentially the public-key version of a keyed cryptographic hash. A 256 VRF comes with a public/private key pair, and only the holder of the 257 private key can compute the hash, but anyone with public key can 258 verify the hash. 260 In NSEC5, the original domain name is hashed twice: 262 1. First, the domain name is hashed using a VRF keyed with the NSEC5 263 private key; the result is called the NSEC5 proof. Only an 264 authoritative server that knows the private NSEC5 key can compute 265 the NSEC5 proof. Any client that knows the public NSEC5 key can 266 validate the NSEC5 proof. 268 2. Second, the NSEC5 proof is hashed. The result is called the 269 NSEC5 hash value. This hash can be computed by any party that 270 knows the input NSEC5 proof. 272 The NSEC5 hash determines the position of a domain name in an NSEC5 273 chain. That is, all the NSEC5 hashes for a zone are sorted in their 274 canonical order, and each consecutive pair forms an NSEC5 RR. 276 To prove an non-existence of a particular domain name in response to 277 a query, the server computes the NSEC5 proof (using the private NSEC5 278 key) on the fly. Then it uses the NSEC5 proof to compute the 279 corresponding NSEC5 hash. It then identifies the NSEC5 RR that 280 covers the NSEC5 hash. In the response message, the server returns 281 the NSEC5 RR, it's corresponding signature (RRSIG RRset), and 282 synthesized NSEC5PROOF RR containing the NSEC5 proof it computed on 283 the fly. 285 To validate the response, the client first uses the public NSEC5 key 286 (stored in the zone as an NSEC5KEY RR) to verify that the NSEC5 proof 287 corresponds with the domain name to be disproved. Then, the client 288 computes the NSEC5 hash from the NSEC5 proof and checks that it is 289 covered by the NSEC5 RR. Finally, it checks that the signature on 290 the NSEC5 RR is valid. 292 4. NSEC5 Algorithms 294 The algorithms used for NSEC5 authenticated denial are independent of 295 the algorithms used for DNSSEC signing. An NSEC5 algorithm defines 296 how the NSEC5 proof and the NSEC5 hash is computed and validated. 298 The input for the NSEC5 proof computation is an RR owner name in the 299 canonical form in the wire format and an NSEC5 private key; the 300 output is an octet string. 302 The input for the NSEC5 hash computation is the corresponding NSEC5 303 proof; the output is an octet string. 305 This document defines RSAFDH-SHA256-SHA256 NSEC5 algorithm as 306 follows: 308 o NSEC5 proof is computed using an RSA based Full Domain Hash (FDH) 309 signature with SHA-256 hash function used internally for input 310 preprocessing. The signature and verification is formally 311 specified in Appendix A. 313 o NSEC5 hash is computed by hashing the NSEC5 proof with the SHA-256 314 hash function as specified in [RFC6234]. 316 o The public key format to be used in NSEC5KEY RR is defined in 317 Section 2 of [RFC3110] and thus is the same as the format used to 318 store RSA public keys in DNSKEY RRs. 320 This document defines EC-P256-SHA256 NSEC5 algorithm as follows: 322 o NSEC5 proof is computed using an Elliptic Curve VRF with FIPS 323 186-3 P-256 curve. The proof computation and verification is 324 formally specified in Appendix B. The curve parameters are 325 specified in [FIPS-186-3] (Section D.1.2.3) and [RFC5114] 326 (Section 2.6). 328 o NSEC5 hash is x-coordinate of the group element gamma from the 329 NSEC5 proof (specified in Appendix B), encoded as a fixed-width 330 32-octet unsigned integer in network byte order. In practice, the 331 hash is a substring of the proof ranging from 2nd to 33th octet of 332 the proof inclusive. 334 o The public key format to be used in NSEC5KEY RR is defined in 335 Section 4 of [RFC6605] and thus is the same as the format used to 336 store ECDSA public keys in DNSKEY RRs. 338 This document defines EC-ED25519-SHA256 NSEC5 as follows: 340 o NSEC5 proof is the same as with EC-P256-SHA256 but using Ed25519 341 elliptic curve with parameters defined in [RFC7748] (Section 4.1). 343 o NSEC5 hash is the same as with EC-P256-SHA256. 345 o The public key format to be used in NSEC5KEY RR is defined in 346 Section 3 of [I-D.ietf-curdle-dnskey-ed25519] and thus is the same 347 as the format used to store Ed25519 public keys in DNSKEY RRs. 349 5. The NSEC5KEY Resource Record 351 The NSEC5KEY RR stores an NSEC5 public key. The key allows clients 352 to verify a validity of NSEC5 proof sent by a server. 354 5.1. NSEC5KEY RDATA Wire Format 356 The RDATA for NSEC5KEY RR is as shown below: 358 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 359 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 360 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 361 | Algorithm | Public Key / 362 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 364 Algorithm is a single octet identifying NSEC5 algorithm. 366 Public Key is a variable sized field holding public key material for 367 NSEC5 proof verification. 369 5.2. NSEC5KEY RDATA Presentation Format 371 The presentation format of the NSEC5KEY RDATA is as follows: 373 The Algorithm field is represented as an unsigned decimal integer. 375 The Public Key field is represented in Base64 encoding. Whitespace 376 is allowed within the Base64 text. 378 6. The NSEC5 Resource Record 380 The NSEC5 RR provides authenticated denial of existence for an RRset. 381 One NSEC5 RR represents one piece of an NSEC5 chain, proving 382 existence of RR types present at the original domain name and also 383 non-existence of other domain names in a part of the hashed domain 384 name space. 386 6.1. NSEC5 RDATA Wire Format 388 The RDATA for NSEC5 RR is as shown below: 390 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 391 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 392 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 393 | Key Tag | Flags | Next Length | 394 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 395 | Next Hashed Owner Name / 396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 397 / Type Bit Maps / 398 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 400 Key Tag field contains the key tag value of the NSEC5KEY RR that 401 validates the NSEC5 RR, in network byte order. The value is computed 402 from the NSEC5KEY RDATA using the same algorithm, which is used to 403 compute key tag values for DNSKEY RRs. The algorithm is defined in 404 [RFC4034]. 406 Flags field is a single octet. The meaning of individual bits of the 407 field is defined in Section 6.2. 409 Next length is an unsigned single octet specifying the length of the 410 Next Hashed Owner Name field in octets. 412 Next Hashed Owner Name field is a sequence of binary octets. It 413 contains an NSEC5 hash of the next domain name in the NSEC5 chain. 415 Type Bit Maps is a variable sized field encoding RR types present at 416 the original owner name matching the NSEC5 RR. The format of the 417 field is equivalent to the format used in NSEC3 RR, described in 418 [RFC5155]. 420 6.2. NSEC5 Flags Field 422 The following one-bit NSEC5 flags are defined: 424 0 1 2 3 4 5 6 7 425 +-+-+-+-+-+-+-+-+ 426 | |W|O| 427 +-+-+-+-+-+-+-+-+ 429 O - Opt-Out flag 431 W - Wildcard flag 433 All the other flags are reserved for future use and MUST be zero. 435 The Opt-Out flag has the same semantics as in NSEC3. The definition 436 and considerations in [RFC5155] are valid, except that NSEC3 is 437 replaced by NSEC5. 439 The Wildcard flag indicates that a wildcard synthesis is possible at 440 the original domain name level (i.e., there is a wildcard node 441 immediately descending from the immediate ancestor of the original 442 domain name). The purpose of the Wildcard flag is to reduce a 443 maximum number of RRs required for authenticated denial of existence 444 proof. 446 6.3. NSEC5 RDATA Presentation Format 448 The presentation format of the NSEC5 RDATA is as follows: 450 The Key Tag field is represented as an unsigned decimal integer. 452 The Flags field is represented as an unsigned decimal integer. 454 The Next Length field is not represented. 456 The Next Hashed Owner Name field is represented as a sequence of 457 case-insensitive Base32hex digits without any whitespace and without 458 padding. 460 The Type Bit Maps representation is equivalent to the representation 461 used in NSEC3 RR, described in [RFC5155]. 463 7. The NSEC5PROOF Resource Record 465 The NSEC5PROOF record is synthesized by the authoritative server on- 466 the-fly. The record contains the NSEC5 proof, proving a position of 467 the owner name in an NSEC5 chain. 469 7.1. NSEC5PROOF RDATA Wire Format 471 The RDATA for NSEC5PROOF is as as shown below: 473 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 474 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 475 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 476 | Key Tag | Owner Name Hash / 477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 479 Key Tag field contains the key tag value of the NSEC5KEY RR that 480 validates the NSEC5PROOF RR, in network byte order. 482 Owner Name Hash is a variable sized sequence of binary octets 483 encoding the NSEC5 proof of the owner name of the RR. 485 7.2. NSEC5PROOF RDATA Presentation Format 487 The presentation format of the NSEC5PROOF RDATA is as follows: 489 The Key Tag field is represented as an unsigned decimal integer. 491 The Owner Name Hash is represented in Base64 encoding. Whitespace is 492 allowed within the Base64 text. 494 8. NSEC5 Proofs 496 This section summarizes all possible types of authenticated denial of 497 existence. For each type the following lists are included: 499 1. Facts to prove. The minimum amount of information an 500 authoritative server must provide to a client to assure the 501 client that the response content is valid. 503 2. Authoritative server proofs. NSEC5 RRs an authoritative server 504 must include in a response to prove the listed facts. 506 3. Validator checks. Individual checks a validating server is 507 required to perform on a response. The response content is 508 considered valid only if all the checks pass. 510 If NSEC5 is said to match a domain name, the owner name of the NSEC5 511 RR has to be equivalent to an NSEC5 hash of that domain name. If an 512 NSEC5 RR is said to cover a domain name, the NSEC5 hash of the domain 513 name must lay strictly between that NSEC5 RR's Owner Name and Next 514 Hashed Owner Name. 516 8.1. Name Error Responses 518 Facts to prove: 520 No RRset matching the QNAME exactly exists. 522 No RRset matching the QNAME via wildcard expansion exists. 524 The QNAME does not fall into a delegation. 526 The QNAME does not fall into a DNAME redirection. 528 Authoritative server proofs: 530 Closest encloser. 532 Next closer name. 534 Validator checks: 536 Closest encloser belongs to the zone. 538 Closest encloser has the Wildcard flag cleared. 540 Closest encloser does not have NS without SOA in the Type Bit Map. 542 Closest encloser does not have DNAME in the Type Bit Maps. 544 Next closer name is derived correctly. 546 8.2. No Data Responses 548 The processing of a No Data response for DS QTYPE differs if the Opt- 549 Out is in effect. For DS QTYPE queries, the validator has two 550 possible checking paths. The correct path can be simply decided by 551 inspecting if the NSEC5 RR in the response matches the QNAME. 553 Note that the Opt-Out is valid only for DS QTYPE queries. 555 8.2.1. No Data Response, Opt-Out Not In Effect 557 Facts to prove: 559 An RRset matching the QNAME exists. 561 No QTYPE RRset matching the QNAME exists. 563 No CNAME RRset matching the QNAME exists. 565 Authoritative server proofs: 567 QNAME. 569 Validator checks: 571 The NSEC5 RR exactly matches the QNAME. 573 The NSEC5 RR does not have QTYPE in the Type Bit Map. 575 The NSEC5 RR does not have CNAME in the Type Bit Map. 577 8.2.2. No Data Response, Opt-Out In Effect 579 Facts to prove: 581 The delegation is not covered by the NSEC5 chain. 583 Authoritative server proofs: 585 Closest provable encloser. 587 Validator checks: 589 Closest provable encloser is in zone. 591 Closest provable encloser covers (not matches) the QNAME. 593 Closest provable encloser has the Opt-Out flag set. 595 8.3. Wildcard Responses 597 Facts to prove: 599 No RRset matching the QNAME exactly exists. 601 No wildcard closer to the QNAME exists. 603 Authoritative server proofs: 605 Next closer name. 607 Validator checks: 609 Next closer name is derived correctly. 611 Next closer name covers (not matches). 613 8.4. Wildcard No Data Responses 615 Facts to prove: 617 No RRset matching the QNAME exactly exists. 619 No QTYPE RRset exists at the wildcard matching the QNAME. 621 No CNAME RRset exists at the wildcard matching the QNAME. 623 No wildcard closer to the QNAME exists. 625 Authoritative server proofs: 627 Source of synthesis (i.e., wildcard at closest encloser). 629 Next closer name. 631 Validator checks: 633 Source of synthesis matches exactly the QNAME. 635 Source of synthesis does not have QTYPE in the Type Bit Map. 637 Source of synthesis does not have CNAME in the Type Bit Map. 639 Next closer name is derived correctly. 641 Next closer name covers (not matches). 643 9. Authoritative Server Considerations 645 9.1. Zone Signing 647 Zones using NSEC5 MUST satisfy the same properties as described in 648 Section 7.1 of [RFC5155], with NSEC3 replaced by NSEC5. In addition, 649 the following conditions MUST be satisfied as well: 651 o If the original owner name has a wildcard label immediately 652 descending from the original owner name, the corresponding NSEC5 653 RR MUST have the Wildcard flag set in the Flags field. Otherwise, 654 the flag MUST be cleared. 656 o The zone apex MUST include an NSEC5KEY RRset containing a NSEC5 657 public key allowing verification of the current NSEC5 chain. 659 The following steps describe one possible method to properly add 660 required NSEC5 related records into a zone. This is not the only 661 such existing method. 663 1. Select an algorithm for NSEC5. Generate the public and private 664 NSEC5 keys. 666 2. Add a NSEC5KEY RR into the zone apex containing the public NSEC5 667 key. 669 3. For each unique original domain name in the zone and each empty 670 non-terminal, add an NSEC5 RR. If Opt-Out is used, owner names 671 of unsigned delegations MAY be excluded. 673 A. The owner name of the NSEC5 RR is the NSEC5 hash of the 674 original owner name encoded in Base32hex without padding, 675 prepended as a single label to the zone name. 677 B. Set the Key Tag field to be the key tag corresponding to the 678 public NSEC5 key. 680 C. Clear the Flags field. If Opt-Out is being used, set the 681 Opt-Out flag. If there is a wildcard label directly 682 descending from the original domain name, set the Wildcard 683 flag. Note that the wildcard can be an empty non-terminal 684 (i.e., the wildcard synthesis does not take effect and 685 therefore the flag is not to be set). 687 D. Set the Next Length field to a value determined by the used 688 NSEC5 algorithm. Leave the Next Hashed Owner Name field 689 blank. 691 E. Set the Type Bit Maps field based on the RRsets present at 692 the original owner name. 694 4. Sort the set of NSEC5 RRs into canonical order. 696 5. For each NSEC5 RR, set the Next Hashed Owner Name field by using 697 the owner name of the next NSEC5 RR in the canonical order. If 698 the updated NSEC5 is the last NSEC5 RR in the chain, the owner 699 name of the first NSEC5 RR in the chain is used instead. 701 The NSEC5KEY and NSEC5 RRs MUST have the same class as the zone SOA 702 RR. Also the NSEC5 RRs SHOULD have the same TTL value as the SOA 703 minimum TTL field. 705 Notice that a use of Opt-Out is not indicated in the zone. This does 706 not affect the ability of a server to prove insecure delegations. 707 The Opt-Out MAY be part of the zone-signing tool configuration. 709 9.2. Zone Serving 711 This specification modifies DNSSEC-enabled DNS responses generated by 712 authoritative servers. In particular, it replaces use of NSEC or 713 NSEC3 RRs in such responses with NSEC5 RRs and adds on-the-fly 714 computed NSEC5PROOF RRs. 716 The authenticated denial of existence proofs in NSEC5 are almost the 717 same as in NSEC3. However, due to introduction of Wildcard flag in 718 NSEC5 RRs, the NSEC5 proof consists from (up to) two NSEC5 RRs, 719 instead of (up to) three. 721 According to a type of a response, an authoritative server MUST 722 include NSEC5 RRs in a response as defined in Section 8. For each 723 NSEC5 RR in the response a matching RRSIG RRset and a synthesized 724 NSEC5PROOF MUST be added as well. 726 A synthesized NSEC5PROOF RR has the owner name set to a domain name 727 exactly matching the name required for the proof. The class and TTL 728 of the RR MUST be the same as the class and TTL value of the 729 corresponding NSEC5 RR. The RDATA are set according to the 730 description in Section 7.1. 732 Notice, that the NSEC5PROOF owner name can be a wildcard (e.g., 733 source of synthesis proof in wildcard No Data responses). The name 734 also always matches the domain name required for the proof while the 735 NSEC5 RR may only cover (not match) the name in the proof (e.g., 736 closest encloser in Name Error responses). 738 If NSEC5 is used, an answering server MUST use exactly one NSEC5 739 chain for one signed zone. 741 NSEC5 MUST NOT be used in parallel with NSEC, NSEC3, or any other 742 authenticated denial of existence mechanism that allows for 743 enumeration of zone contents. 745 Similarly to NSEC3, the owner names of NSEC5 RRs are not represented 746 in the NSEC5 chain and therefore NSEC5 records deny their own 747 existence. The desired behavior caused by this paradox is the same 748 as described in Section 7.2.8 of [RFC5155]. 750 9.3. NSEC5KEY Rollover Mechanism 752 Replacement of the NSEC5 key implies generating a new NSEC5 chain. 753 The NSEC5KEY rollover mechanism is similar to "Pre-Publish Zone 754 Signing Key Rollover" as specified in [RFC6781]. The NSEC5KEY 755 rollover MUST be performed as a sequence of the following steps: 757 1. A new public NSEC5 key is added into the NSEC5KEY RRset in the 758 zone apex. 760 2. The old NSEC5 chain is replaced by a new NSEC5 chain constructed 761 using the new key. This replacement MUST happen as a single 762 atomic operation; the server MUST NOT be responding with RRs from 763 both the new and old chain at the same time. 765 3. The old public key is removed from the NSEC5KEY RRset in the zone 766 apex. 768 The minimal delay between the steps 1. and 2. MUST be the time it 769 takes for the data to propagate to the authoritative servers, plus 770 the TTL value of the old NSEC5KEY RRset. 772 The minimal delay between the steps 2. and 3. MUST be the time it 773 takes for the data to propagate to the authoritative servers, plus 774 the maximum zone TTL value of any of the data in the previous version 775 of the zone. 777 9.4. Secondary Servers 779 This document does not define mechanism to distribute NSEC5 private 780 keys. See Section 14.3 for discussion on the security requirements 781 for NSEC5 private keys. 783 9.5. Zones Using Unknown Hash Algorithms 785 Zones that are signed with unknown NSEC5 algorithm or by an 786 unavailable NSEC5 private key cannot be effectively served. Such 787 zones SHOULD be rejected when loading and servers SHOULD respond with 788 RCODE=2 (Server failure) when handling queries that would fall under 789 such zones. 791 9.6. Dynamic Updates 793 A zone signed using NSEC5 MAY accept dynamic updates. The changes to 794 the zone MUST be performed in a way, that the zone satisfies the 795 properties specified in Section 9.1 at any time. 797 It is RECOMMENDED that the server rejects all updates containing 798 changes to the NSEC5 chain (or related RRSIG RRs) and performs itself 799 any required alternations of the NSEC5 chain induced by the update. 801 Alternatively, the server MUST verify that all the properties are 802 satisfied prior to performing the update atomically. 804 10. Resolver Considerations 806 The same considerations as described in Section 9 of [RFC5155] for 807 NSEC3 apply to NSEC5. In addition, as NSEC5 RRs can be validated 808 only with appropriate NSEC5PROOF RRs, the NSEC5PROOF RRs MUST be all 809 together cached and included in responses with NSEC5 RRs. 811 11. Validator Considerations 812 11.1. Validating Responses 814 The validator MUST ignore NSEC5 RRs with Flags field values other 815 than the ones defined in Section 6.2. 817 The validator MAY treat responses as bogus if the response contains 818 NSEC5 RRs that refer to a different NSEC5KEY. 820 According to a type of a response, the validator MUST verify all 821 conditions defined in Section 8. Prior to making decision based on 822 the content of NSEC5 RRs in a response, the NSEC5 RRs MUST be 823 validated. 825 To validate a denial of existence, zone NSEC5 public keys are 826 required in addition to DNSSEC public keys. Similarly to DNSKEY RRs, 827 the NSEC5KEY RRs are present in the zone apex. 829 The NSEC5 RR is validated as follows: 831 1. Select a correct NSEC5 public key to validate the NSEC5PROOF. 832 The Key Tag value of the NSEC5PROOF RR must match with the key 833 tag value computed from the NSEC5KEY RDATA. 835 2. Validate the NSEC5 proof present in the NSEC5PROOF Owner Name 836 Hash field using the NSEC5 public key. If there are multiple 837 NSEC5KEY RRs matching the key tag, at least one of the keys must 838 validate the NSEC5 proof. 840 3. Compute the NSEC5 hash value from the NSEC5 proof and check if 841 the response contains NSEC5 RR matching or covering the computed 842 NSEC5 hash. The TTL values of the NSEC5 and NSEC5PROOF RRs must 843 be the same. 845 4. Validate the signature of the NSEC5 RR. 847 If the NSEC5 RR fails to validate, it MUST be ignored. If some of 848 the conditions required for an NSEC5 proof is not satisfied, the 849 response MUST be treated as bogus. 851 Notice that determining closest encloser and next closer name in 852 NSEC5 is easier than in NSEC3. NSEC5 and NSEC5PROOF RRs are always 853 present in pairs in responses and the original owner name of the 854 NSEC5 RR matches the owner name of the NSEC5PROOF RR. 856 11.2. Validating Referrals to Unsigned Subzones 858 The same considerations as defined in Section 8.9 of [RFC5155] for 859 NSEC3 apply to NSEC5. 861 11.3. Responses With Unknown Hash Algorithms 863 A validator MUST ignore NSEC5KEY RRs with unknown NSEC5 algorithms. 864 The practical result of this is that zones sighed with unknown 865 algorithms will be considered bogus. 867 12. Special Considerations 869 12.1. Transition Mechanism 871 TODO: Not finished. Following information will be covered: 873 o Transition from NSEC or NSEC3. 875 o Transition from NSEC5 to NSEC/NSEC3 877 o Transition to new algorithms within NSEC5 879 Quick notes on transition from NSEC/NSEC3 to NSEC5: 881 1. Publish NSEC5KEY RR. 883 2. Wait for data propagation to slaves and cache expiration. 885 3. Instantly switch answering from NSEC/NSEC3 to NSEC5. 887 Quick notes on transition from NSEC5 to NSEC/NSEC3: 889 1. Instantly switch answering from NSEC5 to NSEC/NSEC3. 891 2. Wait for NSEC5 RRs expiration in caches. 893 3. Remove NSEC5KEY RR from the zone. 895 12.2. NSEC5 Private Keys 897 This document does not define format to store NSEC5 private key. Use 898 of standardized and adopted format is RECOMMENDED. 900 The NSEC5 private key MAY be shared between multiple zones, however a 901 separate key is RECOMMENDED for each zone. 903 12.3. Domain Name Length Restrictions 905 The NSEC5 creates additional restrictions on domain name lengths. In 906 particular, zones with names that, when converted into hashed owner 907 names exceed the 255 octet length limit imposed by [RFC1035], cannot 908 use this specification. 910 The actual maximum length of a domain name depends on the length of 911 the zone name and used NSEC5 algorithm. 913 All NSEC5 algorithms defined in this document use 256-bit NSEC5 hash 914 values. Such a value can be encoded in 52 characters in Base32hex 915 without padding. When constructing the NSEC5 RR owner name, the 916 encoded hash is prepended to the name of the zone as a single label 917 which includes the length field of a single octet. The maximal 918 length of the zone name in wire format is therefore 202 octets (255 - 919 53). 921 13. Performance Considerations 923 This section compares NSEC, NSEC3, and NSEC5 with regards to the size 924 of denial-of-existence responses and performance impact on the DNS 925 components. 927 13.1. Performance of Cryptographic Operations 929 Additional performance costs depend on the costs of cryptographic 930 operations to a great extent. The following results were retrieved 931 with OpenSSL 1.0.2g, running an ordinary laptop on a single-core of a 932 CPU manufactured in 2016. The parameters of cryptographic operations 933 were chosen to reflect the parameters used in the real-world 934 application of DNSSEC. 936 13.1.1. NSEC3 Hashing Performance 938 NSEC3 uses multiple iterations of the SHA-1 function with an 939 arbitrary salt. The input of the first iteration is the domain name 940 in wire format together with binary salt; the input of the subsequent 941 iterations is the binary digest and the salt. We can assume that the 942 input size will be smaller than 32 octets for most executions. 944 The measured implementation gives a stable performance for small 945 input blocks up to 32 octets. About 4e6 hashes per second can be 946 computed given these parameters. 948 The number of additional iterations in NSEC3 parameters will probably 949 vary between 0 and 20 in reality. Therefore we can expect the NSEC3 950 hash computation performance to be between 2e5 and 4e6 hashes per 951 second. 953 13.1.2. NSEC5 Hashing Performance 955 The NSEC5 hash is computed in two steps: NSEC5 proof computation 956 followed by hashing of the result. As the proof computation involves 957 relatively expensive RSA/EC cryptographic operations, the final 958 hashing will have insignificant impact on the overall performance. 959 We can also expect difference between NSEC5 hashing (signing) and 960 verification time. 962 The measurement results for various NSEC5 algorithms and key sizes 963 are summarized in the following table: 965 +----------------------+--------+-----------+----------+------------+ 966 | NSEC5 algorithm | Key | Proof | Perf. | Perf. | 967 | | size | size | (hash/s) | (verify/s) | 968 | | (bits) | (octets) | | | 969 +----------------------+--------+-----------+----------+------------+ 970 | RSAFDH-SHA256-SHA256 | 1024 | 128 | 9500 | 120000 | 971 | RSAFDH-SHA256-SHA256 | 2048 | 256 | 1500 | 46000 | 972 | RSAFDH-SHA256-SHA256 | 4096 | 512 | 200 | 14000 | 973 | EC-P256-SHA256 | 256 | 81 | 4700 | 4000 | 974 +----------------------+--------+-----------+----------+------------+ 976 Picking a moderate key size of 2048-bits for RSAFDH-SHA256-SHA256, 977 the NSEC5 hash computation performance will be in the order of 10^3 978 issued hashes per second and 10^4 validated hashes per second. 980 EC-P256-SHA256 trades off verification performance for shorter proof 981 size and faster query processing at the nameserver. In that case, 982 both hash computation and verification performance will be in the 983 order of 10^3 hashes per second. 985 13.1.3. DNSSEC Signing Performance 987 For completeness, the following table sumarrizes the signing and 988 verification performance for different DNSSEC signing algorithms: 990 +------------------+--------+-----------+-------------+-------------+ 991 | Algorithm | Key | Signature | Performance | Performance | 992 | | size | size | (sign/s) | (verify/s) | 993 | | (bits) | (octets) | | | 994 +------------------+--------+-----------+-------------+-------------+ 995 | RSASHA256 | 1024 | 128 | 9000 | 140000 | 996 | RSASHA256 | 2048 | 256 | 1500 | 47000 | 997 | RSASHA256 | 4096 | 512 | 200 | 14000 | 998 | ECDSAP256SHA256 | 256 | 64 | 7400 | 4000 | 999 | ECDSAP384SHA384 | 384 | 96 | 5000 | 1000 | 1000 | ECDSAP256SHA256* | 256 | 64 | 24000 | 11000 | 1001 +------------------+--------+-----------+-------------+-------------+ 1003 * highly optimized implementation 1005 The retrieved values are important primarily for the purpose of 1006 evaluating performance of response validation. The signing 1007 performance is usually not that important because the zone is signed 1008 offline. However, when online signing is used, signing performace is 1009 also important. 1011 13.2. Authoritative Server Startup 1013 This section compares additional server startup cost based on the 1014 used authenticated denial mechanism. 1016 NSEC There are no special requirements on processing of a NSEC- 1017 signed zone during an authoritative server startup. The server 1018 handles the NSEC RRs the same way as any other records in the 1019 zone. 1021 NSEC3 The authoritative server can precompute NSEC3 hashes for all 1022 domain names in the NSEC3-signed zone on startup. With respect to 1023 query answering, this can speed up inclusion of NSEC3 RRs for 1024 existing domain names (i.e., Closest provable encloser and QNAME 1025 for No Data response). 1027 NSEC5 Very similar considerations apply for NSEC3 and NSEC5. There 1028 is a strong motivation to precompute the NSEC5 proofs because they 1029 are costly to compute. A possible solution to reduce the startup 1030 time is to store the precomputed NSEC5 proofs and NSEC5 hashes in 1031 a persistent storage. 1033 The impact of NSEC3 and NSEC5 on the authoritative server startup 1034 performance is greatly implementation specific. The server software 1035 vendor has to seek balance between answering performance, startup 1036 slowdown, and additional storage cost. 1038 13.3. NSEC5 Answer Generating and Processing 1040 An authenticated denial proof is required for No Data, Name Error, 1041 Wildcard Match, and Wildcard No Data answer. The number of required 1042 records depends on used authenticated denial mechanism. Their size, 1043 generation cost, and validation cost depend on various zone and 1044 signing parameters. 1046 In the worst case, the following additional records authenticating 1047 the denial will be included into the response: 1049 o Up to two NSEC records and their associated RRSIG records. 1051 o Up to three NSEC3 records and their associated RRSIG records. 1053 o Up to two NSEC5 records and their associated NSEC5PROOF and RRSIG 1054 records. 1056 The following list summarizes additional cryptographic operations 1057 performed by the authoritative server for authenticated denial worst- 1058 case scenario: 1060 o NSEC: 1062 * No cryptographic operations required. 1064 o NSEC3: 1066 * NSEC3 hash for Closest provable encloser (possibly precomputed) 1068 * NSEC3 hash for Next closer name 1070 * NSEC3 hash for wildcard at the closest encloser 1072 o NSEC5: 1074 * NSEC5 proof and hash for Closest provable encloser (possibly 1075 precomputed) 1077 * NSEC5 proof and hash for Next closer name 1079 13.4. Response Lengths 1081 [nsec5ecc] precisely measured response lengths for NSEC, NSEC3 and 1082 NSEC5 using empirical data from a sample second-level domain 1083 containing about 1000 names. The sample zone was signed several 1084 times with different DNSSEC signing algorithms and different 1085 authenticated denial of existence mechanisms. 1087 For DNSKEY algorithms, RSASHA256 (2048-bit) and ECDSAPSHA256 were 1088 considered. For authenticated denial, NSEC, NSEC3, NSEC5 with 1089 RSAFDH-SHA256-SHA256 (2048-bit), and NSEC5 with EC-P256-SHA256 were 1090 considered. (Note that NSEC5 with EC-ED25519-SHA256 is identical to 1091 EC-P256-SHA256 as for response size.) 1093 For each instance of the signed zone, Name Error responses were 1094 collected by issuing DNS queries with a random five-character label 1095 prepended to each actual record name from the zone. The average and 1096 standard deviation of the length of these responses are shown below. 1098 +-----------+--------------+------------------+---------------------+ 1099 | | DNSKEY | Average length | Standard deviation | 1100 | | algorithm | (octets) | (octets) | 1101 +-----------+--------------+------------------+---------------------+ 1102 | NSEC | RSA | 1116 | 48 | 1103 | NSEC | ECDSA | 543 | 24 | 1104 | NSEC3 | RSA | 1440 | 170 | 1105 | NSEC3 | ECDSA | 752 | 84 | 1106 | NSEC5/RSA | RSA | 1767 | 7 | 1107 | NSEC5/EC | ECDSA | 839 | 7 | 1108 +-----------+--------------+------------------+---------------------+ 1110 13.5. Summary 1112 As anticipated, NSEC and NSEC3 are the most efficient authenticated 1113 denial mechanisms, in terms of computation for authoritative server 1114 and resolver. NSEC also has the shortest response lengths. However, 1115 these mechanisms do not prevent zone enumeration. 1117 Regarding mechanisms that do prevent zone enumeration, NSEC5 should 1118 be examined in contrast with Minimally Covering NSEC Records or NSEC3 1119 White Lies [RFC7129]. The following table summarizes their 1120 comparison in terms of response size, performance at the 1121 authoritative server, and performance at the resolver. For NSEC3 1122 White Lies, RSASHA256 (2048-bit) and ECDSAPSHA256 were considered, 1123 and for NSEC5, RSAFDH-SHA256-SHA256 (2048-bit) and EC-P256-SHA256 1124 were considered. 1126 +---------------+-----------------+------------------+--------------+ 1127 | Algorithm | Response length | Authoritative | Resolver | 1128 | | (octets) | (ops/sec) | (ops/sec) | 1129 +---------------+-----------------+------------------+--------------+ 1130 | NSEC3WL/RSA | 1440 | 1500 | 47000 | 1131 | NSEC3WL/ECDSA | 752 | 7400 | 4000 | 1132 | NSEC5/RSA | 1767 | 1500 | 46000 | 1133 | NSEC5/EC | 839 | 4700 | 4000 | 1134 +---------------+-----------------+------------------+--------------+ 1135 NSEC5 responses lengths are only slighly longer than NSEC3 response 1136 lengths: NSEC5/RSA has responses that are about 22% longer than 1137 NSEC3/RSA, while NSEC5/EC has responses that are about 13% longer 1138 than NSEC3/ECDSA. For both NSEC3 and NSEC5, it is clear that EC- 1139 based solutions give much shorter responses. 1141 Regarding the computation performance, with RSA the difference is 1142 negligible for both nameserver and resolver, whereas with the EC- 1143 based schemes there is no slowdown for the resolver, and a slowdown 1144 of 1.5x for the server. Importantly, we expect the slowdown to be 1145 smaller in practice because NSEC3 entails three signing/verifying 1146 computations per query in the worst case (closest encloser, next 1147 closer, wildcard at closest encloser) whereas NSEC5 requires only 1148 two. The table above does not capture this issue, it just measures 1149 number of signing/verifying operations per second. Future versions 1150 of this draft will more accurately measure and compare NSEC5 1151 performance. 1153 Note also that while NSEC3 White Lies outperforms NSEC5 for certain 1154 cases, NSEC3 White Lies require authoratitive nameserver to store the 1155 private zone-signing key, making each nameserver a potential point of 1156 compromise. 1158 14. Security Considerations 1160 14.1. Zone Enumeration Attacks 1162 NSEC5 is robust to zone enumeration via offline dictionary attacks by 1163 any attacker that does not know the NSEC5 private key. Without the 1164 private NSEC5 key, that attacker cannot compute the NSEC5 proof that 1165 corresponds to a given name; the only way it can learn the NSEC5 1166 proof value for a given name is by sending a queries for that name to 1167 the authoritative server. Without the NSEC5 proof value, the 1168 attacker cannot learn the NSEC5 hash value. Thus, even an attacker 1169 that collects the entire chain of NSEC5 RR for a zone cannot use 1170 offline attacks to "reverse" that NSEC5 hash values in these NSEC5 RR 1171 and thus learn which names are present in the zone. A formal 1172 cryptographic proof of this property is in [nsec5]. 1174 14.2. Hash Collisions 1176 Hash collisions between QNAME and the owner name of an NSEC5 RR may 1177 occur. When they do, it will be impossible to prove the non- 1178 existence of the colliding QNAME. However, with SHA-256, this is 1179 highly unlikely (on the order of 1 in 2^128). Note that DNSSEC 1180 already relies on the presumption that a cryptographic hash function 1181 is collision resistant, since these hash functions are used for 1182 generating and validating signatures and DS RRs. See also the 1183 discussion on key lengths in [nsec5]. 1185 14.3. Compromise of the Private NSEC5 Key 1187 NSEC5 requires authoritative servers to hold the private NSEC5 key, 1188 but not the private zone-signing keys or the private key-signing keys 1189 for the zone. 1191 The private NSEC5 key needs only be as secure as the DNSSEC records 1192 whose the privacy (against zone-enumeration attacks) that NSEC5 is 1193 protecting. This is because even an adversary that knows the private 1194 NSEC5 key cannot modify the contents of the zone; this is because the 1195 zone contents are signed using the private zone-signing key, while 1196 the private NSEC5 key is only used to compute NSEC5 proof values. 1197 Thus, a compromise of the private NSEC5 keys does not lead to a 1198 compromise of the integrity of the DNSSEC record in the zone; 1199 instead, all that is lost is privacy against zone enumeration, if the 1200 attacker that knows the private NSEC5 key can compute NSEC5 hashes 1201 offline, and thus launch offline dictionary attacks. Thus, a 1202 compromise of the private NSEC5 key effectively downgrades the 1203 security of NSEC5 to that of NSEC3. A formal cryptographic proof of 1204 this property is in [nsec5]. 1206 If a zone owner wants to preserve this property of NSEC5, the zone 1207 owner SHOULD choose the NSEC5 private key to be different from the 1208 private zone-signing keys or key-signing keys for the zone. 1210 14.4. Key Length Considerations 1212 The NSEC5 key must be long enough to withstand attacks for as long as 1213 the privacy of the zone is important. Even if the NSEC5 key is 1214 rolled frequently, its length cannot be too short, because zone 1215 privacy may be important for a period of time longer than the 1216 lifetime of the key. (For example, an attacker might collect the 1217 entire chain of NSEC5 RR for the zone over one short period, and 1218 then, later (even after the NSEC5 key expires) perform an offline 1219 dictionary attack that attempt to "reverse" the NSEC5 hash values 1220 present in the NSEC5 RRs.) This is in contrast to zone-signing and 1221 key-signing keys used in DNSSEC; these keys, which ensure the 1222 authenticity and integrity of the zone contents need to remain secure 1223 only during their lifetime. 1225 14.5. Transitioning to a New NSEC5 Algorithm 1227 Although the NSEC5KEY RR formats include a hash algorithm parameter, 1228 this document does not define a particular mechanism for safely 1229 transitioning from one NSEC5 algorithm to another. When specifying a 1230 new hash algorithm for use with NSEC5, a transition mechanism MUST 1231 also be defined. It is possible that the only practical and 1232 palatable transition mechanisms may require an intermediate 1233 transition to an insecure state, or to a state that uses NSEC or 1234 NSEC3 records instead of NSEC5. 1236 15. IANA Considerations 1238 This document updates the IANA registry "Domain Name System (DNS) 1239 Parameters" in subregistry "Resource Record (RR) TYPEs", by defining 1240 the following new RR types: 1242 NSEC5KEY value XXX. 1244 NSEC5 value XXX. 1246 NSEC5PROOF value XXX. 1248 This document creates a new IANA registry for NSEC5 algorithms. This 1249 registry is named "DNSSEC NSEC5 Algorithms". The initial content of 1250 the registry is: 1252 0 is Reserved. 1254 1 is RSAFDH-SHA256-SHA256. 1256 2 is EC-P256-SHA256. 1258 3 is EC-ED25519-SHA256. 1260 4-255 is Available for assignment. 1262 This document updates the IANA registry "DNS Security Algorithm 1263 Numbers" by defining following aliases: 1265 XXX is NSEC5-RSASHA256, alias for RSASHA256 (8). 1267 XXX is NSEC5-RSASHA512, alias for RSASHA512 (10). 1269 XXX is NSEC5-ECDSAP256SHA256 alias for ECDSAP256SHA256 (13). 1271 XXX is NSEC5-ECDSAP384SHA384 alias for ECDSAP384SHA384 (14). 1273 16. Contributors 1275 This document would not be possible without help of Moni Naor 1276 (Weizmann Institute), Sachin Vasant (Cisco Systems), Leonid Reyzin 1277 (Boston University), and Asaf Ziv (Weizmann Institute) who 1278 contributed to the design of NSEC5, and Ondrej Sury (CZ.NIC Labs) who 1279 provided advice on its implementation. 1281 17. References 1283 17.1. Normative References 1285 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1286 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1287 . 1289 [RFC1035] Mockapetris, P., "Domain names - implementation and 1290 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1291 November 1987, . 1293 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1294 Requirement Levels", BCP 14, RFC 2119, 1295 DOI 10.17487/RFC2119, March 1997, 1296 . 1298 [RFC2136] Vixie, P., Ed., Thomson, S., Rekhter, Y., and J. Bound, 1299 "Dynamic Updates in the Domain Name System (DNS UPDATE)", 1300 RFC 2136, DOI 10.17487/RFC2136, April 1997, 1301 . 1303 [RFC2181] Elz, R. and R. Bush, "Clarifications to the DNS 1304 Specification", RFC 2181, DOI 10.17487/RFC2181, July 1997, 1305 . 1307 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 1308 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 1309 . 1311 [RFC3110] Eastlake 3rd, D., "RSA/SHA-1 SIGs and RSA KEYs in the 1312 Domain Name System (DNS)", RFC 3110, DOI 10.17487/RFC3110, 1313 May 2001, . 1315 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 1316 Standards (PKCS) #1: RSA Cryptography Specifications 1317 Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February 1318 2003, . 1320 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1321 Rose, "DNS Security Introduction and Requirements", 1322 RFC 4033, DOI 10.17487/RFC4033, March 2005, 1323 . 1325 [RFC4034] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1326 Rose, "Resource Records for the DNS Security Extensions", 1327 RFC 4034, DOI 10.17487/RFC4034, March 2005, 1328 . 1330 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1331 Rose, "Protocol Modifications for the DNS Security 1332 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1333 . 1335 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1336 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 1337 . 1339 [RFC5114] Lepinski, M. and S. Kent, "Additional Diffie-Hellman 1340 Groups for Use with IETF Standards", RFC 5114, 1341 DOI 10.17487/RFC5114, January 2008, 1342 . 1344 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS 1345 Security (DNSSEC) Hashed Authenticated Denial of 1346 Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008, 1347 . 1349 [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 1350 (SHA and SHA-based HMAC and HKDF)", RFC 6234, 1351 DOI 10.17487/RFC6234, May 2011, 1352 . 1354 [RFC6605] Hoffman, P. and W. Wijngaards, "Elliptic Curve Digital 1355 Signature Algorithm (DSA) for DNSSEC", RFC 6605, 1356 DOI 10.17487/RFC6605, April 2012, 1357 . 1359 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 1360 for Security", RFC 7748, DOI 10.17487/RFC7748, January 1361 2016, . 1363 [I-D.ietf-curdle-dnskey-ed25519] 1364 Sury, O. and R. Edmonds, "Ed25519 for DNSSEC", draft-ietf- 1365 curdle-dnskey-ed25519-01 (work in progress), February 1366 2016. 1368 [FIPS-186-3] 1369 National Institute for Standards and Technology, "Digital 1370 Signature Standard (DSS)", FIPS PUB 186-3, June 2009. 1372 [SECG1] Standards for Efficient Cryptography Group (SECG), "SEC 1: 1373 Elliptic Curve Cryptography", Version 2.0, May 2009, 1374 . 1376 17.2. Informative References 1378 [nsec5] Goldberg, S., Naor, M., Papadopoulos, D., Reyzin, L., 1379 Vasant, S., and A. Ziv, "NSEC5: Provably Preventing DNSSEC 1380 Zone Enumeration", in NDSS'15, July 2014. 1382 [nsec5ecc] 1383 Goldberg, S., Naor, M., Papadopoulos, D., and L. Reyzin, 1384 "NSEC5 from Elliptic Curves", in ePrint Cryptology Archive 1385 2016/083, January 2016. 1387 [nsec3gpu] 1388 Wander, M., Schwittmann, L., Boelmann, C., and T. Weis, 1389 "GPU-Based NSEC3 Hash Breaking", in IEEE Symp. Network 1390 Computing and Applications (NCA), 2014. 1392 [nsec3walker] 1393 Bernstein, D., "Nsec3 walker", 2011, 1394 . 1396 [RFC6781] Kolkman, O., Mekking, W., and R. Gieben, "DNSSEC 1397 Operational Practices, Version 2", RFC 6781, 1398 DOI 10.17487/RFC6781, December 2012, 1399 . 1401 [RFC7129] Gieben, R. and W. Mekking, "Authenticated Denial of 1402 Existence in the DNS", RFC 7129, DOI 10.17487/RFC7129, 1403 February 2014, . 1405 Appendix A. RSA Full Domain Hash Algorithm 1407 The Full Domain Hash (FDH) is a RSA-based scheme that allows 1408 authentication of hashes using public-key cryptography. 1410 In this document, the notation from [RFC3447] is used. 1412 Used parameters: 1414 (n, e) - RSA public key 1416 K - RSA private key 1418 k - length of the RSA modulus n in octets 1420 Fixed options: 1422 Hash - hash function to be used with MGF1 1424 Used primitives: 1426 I2OSP - Coversion of a nonnegative integer to an octet string as 1427 defined in Section 4.1 of [RFC3447] 1429 OS2IP - Coversion of an octet string to a nonnegative integer as 1430 defined in Section 4.2 of [RFC3447] 1432 RSASP1 - RSA signature primitive as defined in Section 5.2.1 of 1433 [RFC3447] 1435 RSAVP1 - RSA verification primitive as defined in Section 5.2.2 of 1436 [RFC3447] 1438 MGF1 - Mask Generation Function based on a hash function as 1439 defined in Section B.2.1 of [RFC3447] 1441 A.1. FDH signature 1443 FDH_SIGN(K, M) 1445 Input: 1447 K - RSA private key 1449 M - message to be signed, an octet string 1451 Output: 1453 S - signature, an octet string of length k 1455 Steps: 1457 1. EM = MGF1(M, k - 1) 1459 2. m = OS2IP(EM) 1461 3. s = RSASP1(K, m) 1463 4. S = I2OSP(s, k) 1465 5. Output S 1467 A.2. FDH verification 1469 FDH_VERIFY((n, e), M, S) 1471 Input: 1473 (n, e) - RSA public key 1475 M - message whose signature is to be verified, an octet string 1477 S - signature to be verified, an octet string of length k 1479 Output: 1481 "valid signature" or "invalid signature" 1483 Steps: 1485 1. s = OS2IP(S) 1487 2. m = RSAVP1((n, e), s) 1489 3. EM = I2OSP(m, k - 1) 1491 4. EM' = MGF1(M, k - 1) 1493 5. If EM and EM' are the same, output "valid signature"; else output 1494 "invalid signature". 1496 Appendix B. Elliptic Curve VRF 1498 The Elliptic Curve Verifiable Random Function (VRF) is a EC-based 1499 scheme that allows authentication of hashes using public-key 1500 cryptography. 1502 Fixed options: 1504 G - EC group 1506 Used parameters: 1508 g^x - EC public key 1510 x - EC private key 1512 q - primer order of group G 1514 g - generator of group G 1516 Used primitives: 1518 "" - empty octet string 1520 || - octet string concatenation 1522 p^k - EC point multiplication 1524 p1*p2 - EC point addition 1526 SHA256 - hash function SHA-256 as specified in [RFC6234] 1528 ECP2OS - EC point to octet string conversion with point 1529 compression as specified in Section 2.3.3 of [SECG1] 1531 OS2ECP - octet string to EC point conversion with point 1532 compression as specified in Section 2.3.4 of [SECG1] 1534 B.1. ECVRF Hash To Curve 1536 ECVRF_hash_to_curve(m) 1538 Input: 1540 m - value to be hashed, an octet string 1542 Output: 1544 h - hashed value, EC point 1546 Steps: 1548 1. c = 0 1549 2. C = I2OSP(c, 4) 1551 3. xc = SHA256(m || C) 1553 4. p = 0x02 || xc 1555 5. If p is not a valid octet string representing encoded compressed 1556 point in G: 1558 A. c = c + 1 1560 B. Go to step 2. 1562 6. h = OS2ECP(p) 1564 7. Output h 1566 B.2. ECVRF Auxiliary Functions 1568 B.2.1. ECVRF Hash Points 1570 ECVRF_hash_points(p_1, p_2, ..., p_n) 1572 Input: 1574 p_x - EC point in G 1576 Output: 1578 h - hash value, integer between 0 and 2^128-1 1580 Steps: 1582 1. P = "" 1584 2. for p in [p_1, p_2, ... p_n]: 1585 P = P || ECP2OS(p) 1587 3. h' = SHA256(P) 1589 4. h = OS2IP(first 16 octets of h') 1591 5. Output h 1593 B.2.2. ECVRF Proof To Hash 1595 ECVRF_proof_to_hash(gamma) 1597 Input: 1599 gamma - VRF proof, EC point in G with coordinates (x, y) 1601 Output: 1603 beta - VRF hash, octet string (32 octets) 1605 Steps: 1607 1. beta = I2OSP(x, 32) 1609 2. Output beta 1611 Note: Because of the format of compressed form of an elliptic curve, 1612 the hash can be retrieved from an encoded gamma simply by omitting 1613 the first octet of the gamma. 1615 B.2.3. ECVRF Decode Proof 1617 ECVRF_decode_proof(pi) 1619 Input: 1621 pi - VRF proof, octet string (81 octets) 1623 Output: 1625 gamma - EC point 1627 c - integer between 0 and 2^128-1 1629 s - integer between 0 and 2^256-1 1631 Steps: 1633 1. let gamma', c', s' be pi split after 33-rd and 49-th octet 1635 2. gamma = OS2ECP(gamma') 1637 3. c = OS2IP(c') 1639 4. s = OS2IP(s') 1640 5. Output gamma, c, and s 1642 B.3. ECVRF Signing 1644 ECVRF_sign(g^x, x, alpha) 1646 Input: 1648 g^x - EC public key 1650 x - EC private key 1652 alpha - message to be signed, octet string 1654 Output: 1656 pi - VRF proof, octet string (81 octets) 1658 beta - VRF hash, octet string (32 octets) 1660 Steps: 1662 1. h = ECVRF_hash_to_curve(alpha) 1664 2. gamma = h^x 1666 3. choose a nonce k from [0, q-1] 1668 4. c = ECVRF_hash_points(g, h, g^x, h^x, g^k, h^k) 1670 5. s = k - c*q mod q 1672 6. pi = ECP2OS(gamma) || I2OSP(c, 16) || I2OSP(s, 32) 1674 7. beta = h2(gamma) 1676 8. Output pi and beta 1678 B.4. ECVRF Verification 1680 ECVRF_VERIFY(g^x, pi, alpha) 1682 Input: 1684 g^x - EC public key 1686 pi - VRF proof, octet string 1687 alpha - message to verify, octet string 1689 Output: 1691 "valid signature" or "invalid signature" 1693 beta - VRF hash, octet string (32 octets) 1695 Steps: 1697 1. gamma, c, s = ECVRF_decode_proof(pi) 1699 2. u = (g^x)^c * g^s 1701 3. h = ECVRF_hash_to_curve(alpha) 1703 4. v = gamma^c * h^s 1705 5. c' = ECVRF_hash_points(g, h, g^x, gamma, u, v) 1707 6. beta = ECVRF_proof_to_hash(gamma) 1709 7. If c and c' are the same, output "valid signature"; else output 1710 "invalid signature". Output beta. 1712 [[CREF1: TODO: check validity of gamma before hashing --Jan]] 1714 Appendix C. Change Log 1716 Note to RFC Editor: if this document does not obsolete an existing 1717 RFC, please remove this appendix before publication as an RFC. 1719 pre 00 - initial version of the document submitted to mailing list 1720 only 1722 00 - fix NSEC5KEY rollover mechanism, clarify NSEC5PROOF RDATA, 1723 clarify inputs and outputs for NSEC5 proof and NSEC5 hash 1724 computation 1726 01 - added Performance Considerations section 1728 02 - Elliptic Curve based VRF for NSEC5 proofs; response sizes 1729 based on empirical data 1731 Appendix D. Open Issues 1733 Note to RFC Editor: please remove this appendix before publication as 1734 an RFC. 1736 1. Consider alternative way to signalize NSEC5 support. The NSEC5 1737 could use only one DNSSEC algorithm identifier, and the actual 1738 algorithm to be used for signing can be the first octet in DNSKEY 1739 public key field and RRSIG signature field. Similar approach is 1740 used by PRIVATEDNS and PRIVATEOID defined in [RFC4034]. 1742 2. How to add new NSEC5 hashing algorithm. We will need to add new 1743 DNSSEC algorithm identifiers again. 1745 3. NSEC and NSEC3 define optional steps for hash collisions 1746 detection. We don't have a way to avoid them if they really 1747 appear (unlikely). We would have to drop the signing key and 1748 generate a new one. Which cannot be done instantly. 1750 4. Write Special Considerations section. 1752 5. Contributor list has to be completed. 1754 Authors' Addresses 1756 Jan Vcelak 1757 CZ.NIC 1758 Milesovska 1136/5 1759 Praha 130 00 1760 CZ 1762 EMail: jan.vcelak@nic.cz 1764 Sharon Goldberg 1765 Boston University 1766 111 Cummington St, MCS135 1767 Boston, MA 02215 1768 USA 1770 EMail: goldbe@cs.bu.edu 1771 Dimitrios Papadopoulos 1772 Boston University 1773 111 Cummington St, MCS135 1774 Boston, MA 02215 1775 USA 1777 EMail: dipapado@bu.edu