view Side-By-Side changes
318 Acton Street +1 508-371-7148(fax) dee@world.std.com Carlisle, MA 01741 USA +1 703-620-4200(main office, Reston, VA) DNS Security Working Group Donald E. Eastlake, 3rd INTERNET-DRAFTDECCyberCash Charles W. Kaufman Iris Expires:1 Jul24 December 19952 Jan25 June 1995 Domain Name SystemProtocolSecurity Extensions ------ ---- ------ -------------------------- Status of This Document This draft, file namedraft-ietf-dnssec-secext-03.txt,draft-ietf-dnssec-secext-04.txt, is intended to be become aproposed standardProposed Standard RFC. Distribution of this document is unlimited. Comments should be sent to the DNS Security Working Group mailing list <dns-security@tis.com> or to the authors. This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months. Internet-Drafts may be updated, replaced, or obsoleted by other documents at any time. It is not appropriate to use Internet- Drafts as reference material or to cite them other than as a ``working draft'' or ``work in progress.'' To learn the current status of any Internet-Draft, please check the 1id-abstracts.txt listing contained in the Internet-Drafts Shadow Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, munnari.oz.au, or ftp.is.co.za. Eastlake, Kaufman [Page 1] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 Abstract The Domain Name System (DNS) has become a critical operational part of the Internet infrastructure yet it has no strong security mechanisms to assure data integrity or authentication. Extensions to the DNS are described that provide these services to security aware resolvers or applications through the use of cryptographic digital signatures. These digital signatures are included in secured zones as resource records. Security can still be provided even through non-security aware DNSservers.servers in many cases. The extensions also provide for the storage of authenticated public keys in the DNS. This storage of keys can supportageneral public key distribution service as well as DNS security. The stored keys enable security aware resolvers to learn the authenticating key of zones in addition to keys for which they are initially configured. Keys associated with DNS names can be retrieved to support other protocols. Provision is made for a variety of key types and algorithms. In addition, the security extensions provide for the optional authentication of DNS protocol transactions. Acknowledgements The significant contributions of the following persons (in alphabetic order) to this draft are gratefully acknowledged: Madelyn Badger, Matt Crawford, James M. Galvin, Olafur Gudmundsson, Sandy Murphy, Masataka Ohta, Michael A. Patton, Jeffrey I. Schiller. Eastlake, Kaufman [Page 2] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 Table of Contents Status of This Document....................................1 Abstract...................................................2 Acknowledgements...........................................2 Table of Contents..........................................3 1.Introduction............................................5Overview of Contents....................................5 2.BriefOverview of theExtensions.......................6Extensions.............................6 2.1 Services Not Provided..................................6 2.2 Key Distribution.......................................6 2.3 Data Origin Authentication and Integrity...............72.3.22.3.1 The SIG Resource Record..............................72.3.32.3.2 Authenticating NameNon-existence....................8 2.3.5and Type Non-existence...........8 2.3.3 SpecialProblemsConsiderations WithTime-to-Live...................8Time-to-Live.............8 2.3.4 Special Considerations at Delegation Points..........9 2.3.5 Special Considerations with CNAME RRs................9 2.3.6 Signers Other Than The Zone..........................9 2.4 DNS TransactionAuthentication.........................9Authentication........................10 3. The KEY ResourceRecord................................10Record................................11 3.1 KEY RDATAformat......................................10format......................................11 3.2 ObjectTypes andTypes, DNSNamesNames, andKeys...................10Keys.....................11 3.3 The KEY RR FlagOctet.................................11Field.................................12 3.4 The Protocol Octet....................................14 3.5 The KEY AlgorithmVersionNumber and the MD5/RSAAlgorithm.......12 3.5Algorithm....14 3.6 Interaction of Flags, Algorithm, and Protocol Bytes...15 3.7 KEY RRs in the Construction ofResponses..............13 3.6Responses..............16 3.8 File Representation of KEYRRs........................14RRs........................16 4. The SIG ResourceRecord................................15Record................................18 4.1 SIG RDATAFormat......................................15Format......................................18 4.1.1 SignatureFormat....................................17Data......................................20 4.1.2SIG RRs Covering Type ANY...........................18MD5/RSA Algorithm Signature Calculation.............21 4.1.3 Zone Transfer (AXFR)SIG............................18SIG............................22 4.1.4 TransactionSIGs....................................19SIGs....................................22 4.2 SIG RRs in the Construction ofResponses..............19Responses..............23 4.3 Processing Responseswithand SIGRRs.....................20RRs......................23 4.4 Signature Expiration, TTLs, and Validity..............24 4.5 File Representation of SIGRRs........................21RRs........................25 5. Non-existentNames.....................................22Names and Types...........................26 5.1 TheNXDNXT ResourceRecord...............................22Record...............................26 5.2NXDNXT RDATAFormat......................................23Format......................................27 5.3Example...............................................23Example...............................................27 5.4 Interaction ofNXDNXT RRs and WildcardRRs...............23RRs...............28 5.5 BlockingNXDNXT Pseudo-ZoneTransfers....................24 6. How to Resolve Securely................................25 6.1 Boot File Format......................................25 6.2 Chaining Through Zones................................25 6.3 Secure Time...........................................27Transfers....................28 Eastlake, Kaufman [Page 3] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 5.6 Special Considerations at Delegation Points...........29 6. The AD and CD Bits and How to Resolve Securely.........30 6.1 The AD and CD Header Bits.............................30 6.2 Boot File Format......................................31 6.3 Chaining Through Zones................................32 6.4 Secure Time...........................................33 7. OperationalConsiderations.............................28Considerations.............................34 7.1 Key SizeConsiderations...............................28Considerations...............................34 7.2 KeyStorage...........................................28Storage...........................................35 7.3 KeyGeneration........................................29Generation........................................35 7.4 KeyLifetimes.........................................29Lifetimes.........................................35 7.5 SignatureLifetime....................................30Lifetime....................................36 7.6Root..................................................30Root..................................................36 8.Conformance............................................31Conformance............................................37 8.1 ServerConformance....................................31Conformance....................................37 8.2 ResolverConformance..................................31Conformance..................................37 9. SecurityConsiderations................................32 References................................................32Considerations................................38 References................................................38 AuthorsAddresses.........................................33Addresses.........................................39 Expiration and FileName..................................33Name..................................39 Appendix: Base 64Encoding................................34Encoding................................40 Eastlake, Kaufman [Page 4] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 1.IntroductionOverview of Contents This draft describes extensions of theDNSDomain Name System (DNS) protocol to support DNS security and public key distribution.This draftIt assumes that the reader is familiar with the Domain Name System, particularly as described in RFCs 1034 and 1035.Eastlake, Kaufman [Page 5] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 2. Brief OverviewSection 2 provides an overview of theExtensions The DNS protocolextensionsprovide three distinct services:and the keydistribution as described in section 2.2 below,distribution, data originauthentication as described in section 2.3 below,authentication, and transactionauthentication, describedsecurity they provide. Section 3 discusses the KEY resource record, its structure, use insection 2.4 below. 2.1 Services Not Provided It is part ofDNS responses, and file representation. These resource records represent thedesign philosophypubic keys of entities named in the DNSthatand are used for key distribution. Section 4 discusses thedataSIG digital signature resource record, its structure, use init is publicDNS responses, andthatfile representation. These resource records are used to authenticate other resource records in the DNSgives the same answers to all inquirers. Following this philosophy, no attempt has been madeand optionally toinclude any sort ofauthenticate DNS transactions. Section 5 discusses the NXT resource record and its use in DNS responses. The NXT RR permits authenticated denial in the DNS of the existence of a name or of a particular type for an existing name. Section 6 discusses how a resolver can be configured with a starting key or keys and proceed to securely resolve DNS requests. Interactions between resolvers and servers are discussed for all combinations of security aware and security non-aware. Two additional query header bits are defined for signaling between resolvers and servers. Section 7 reviews a variety of operational considerations including key generation, lifetime, and storage. Section 8 defines levels of conformance for resolvers and servers. Section 9 provides a few paragraphs on overall security considerations. An Appendix is provided that gives some details of base64 encoding which is used in the file representation of some RR's defined in this draft. Eastlake, Kaufman [Page 5] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 2. Overview of the Extensions The Domain Name System (DNS) protocol security extensions provide three distinct services: key distribution as described in Section 2.2 below, data origin authentication as described in Section 2.3 below, and transaction authentication, described in Section 2.4 below. Special considerations related to time to live, CNAMEs, and delegation points are also discussed in Section 2.3. 2.1 Services Not Provided It is part of the design philosophy of the DNS that the data in it is public and that the DNS gives the same answers to all inquirers. Following this philosophy, no attempt has been made to include any sort of access control lists or other means to differentiate inquirers. In addition, no effort has been made to provide for any confidentiality for queries or responses. (This service may be available viaan IPother protocols such as a network level security protocolfor which there is current an IETF working group.)providing confidentiality.) 2.2 Key DistributionThe resourceResource records (RRs) are defined to associate keys with DNS names. This permits the DNS to be used as a general public key distribution mechanism in support of the data origin authentication and transaction authentication DNS services as well as other securityservices such as IP level security.services. The syntax of a KEY resource record (RR) is described in Section 3. It includesthe name of the entity the key is associated with (frequently but not always the KEY resource record owner name),an algorithm identifier, flags indicating the type of entity the key is associated with and/or asserting that there is no key associated with that entity, and the actual public key parameters. Under conditions described in Section 3, security aware DNS serverswillmay automatically attempt to return KEY resources as additional information, along with those resource records actually requested, to minimizequery traffic.the number of queries needed. Eastlake, Kaufman [Page 6] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 2.3 Data Origin Authentication and Integrity Security is provided by associating with resource records in the DNS cryptographically generated digital signatures. Commonly, there will be a single private key that signs for an entire zone. If a security aware resolver reliably learns the public key of the zone, it canverify that all theverify, for any data read from that zone, that it was properly authorized and is reasonably current. The expected implementation is for the zone private key to be kept off-line and used to re-sign all of the records in the zone periodically. The data origin authentication key belongs to the zone and not to the servers that store copies of the data. That means compromise of a server or even all servers for a zone will not necessarily affect the degree of assurance that a resolver has that the data is genuine. A resolver can learn the public key of a zone either by reading it from DNS or by having it staticly configured. To reliably learn the public key by reading it from DNS, the key itself must be signed. Thus, to provide a reasonable degree of security, the resolver must be configured with at least the public key of onezone.zone that it can use to authenticate signatures. From that, it can securely read the public keys of other zones if the intervening zones in the DNS tree are secure.It(It is in principle more secure to have the resolver manually configured with the public keys of multiple zones, since then the compromise of a single zone would not permit the faking of information from other zones. It is also more administratively cumbersome, however, particularly when public keyschange.change.) Adding origin authentication and integrity requires no change to the "on-the-wire" DNS protocol beyond the addition of the signature resource types (and, as a practical matter, the key resource type needed for key distribution). This service can be supported by existing resolver and server implementations so long as theycouldcan support the additional resourcetypes.types (see Section 8) with the one exception that CNAME referals can not be authenticated if they are from non-security aware servers (see Section 2.3.5). If signatures are always separately retrieved and verified when retrieving the information they authenticate, there will be more trips to the server and performance will suffer. To avoid this, security aware servers mitigate that degradation byautomaticallyalways sendingexactlythe signature(s) needed.2.3.22.3.1 The SIG Resource Record The syntax of a SIG resource record (signature) is described in Section 4. It includes the type of the RR(s) being signed, the name Eastlake, Kaufman [Page 7] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 of the signer, the time at which the signature was created, the time it expires (when it is no longer to be believed), its original timeEastlake, Kaufman [Page 7] INTERNET-DRAFT DNS Protocol Security Extensions January 1995to live (which may be longer than its current time to live but cannot be shorter), the cryptographic algorithm in use, and the actual signature. Every name in a zone supporting signed data will have associated with it at least one SIG resource record for each resource type under that name. A security aware server supporting the performance enhanced version of the DNS protocol security extensions will attempt to return, with all records retrieved, the corresponding SIGs. If a server does not support the protocol, the resolver must retrieve all the SIG records for a name and select the one or ones that sign the resource record(s) that resolver is interested in.2.3.32.3.2 Authenticating Name and Type Non-existence The above security mechanism provides only a way to sign existing RRs in a zone.Data origin"Data origin" authentication is not obviously provided for the non-existence of a domain name in azone.zone or the non-existence of a type for an existing name. This gap is filled by theNXDNXT RR which authenticatably asserts a range of non-existent names in azone. The owner of the NXD RR is the start of such a rangerzone andits RDATA istheend ofnon-existence types for therange; however, there are additional complexities due to wildcards.initial name in that range. Section65 below covers theNXDNXT RR.2.3.52.3.3 SpecialProblemsConsiderations With Time-to-Live A digital signature will fail to verify if any change has occurred to the data between the time it was originally signed and the time the signature is verified. This conflicts with our desire to have the time-to-live field tick down when resource records are cached. This could be avoided by leaving the time-to-live out of the digital signature, but that would allow unscrupuloussecondariesservers to set arbitrarily long time to live values undetected. Instead, we include the "original" time-to-live in the signature and communicate that data in addition to the current time-to-live. Unscrupulous servers under this scheme can manipulate the time to live but a security aware resolver will bound the TTL value it uses at the original signed value. Separately, signatures include a time signed and an expiration time. A resolver that knowsanthe absolute time can determine securely whether a signature has expired. It is not possible to rely solely on the signature expiration as a substitute for the TTL, however,singesince non-security aware servers must still be supported. Eastlake, Kaufman [Page 8] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 19952.3.5 Signers Other Than The Zone There are two general cases where a SIG resource record is signed by other than the zone private key. One is for future support of dynamic update where an entity is permitted2.3.4 Special Considerations at Delegation Points DNS security would like toauthenticate/update its own records. The public keyview each zone as a unit of data completely under theentity must be present incontrol of theDNSzone owner andbe appropriately signed but the other RR(s) may besignedwithby theentity'szone's key.The other is for support of transaction authentication as described in Section 2.3 below. 2.4 DNS Transaction Authentication The data origin authentication service described above protects resource records but provides no protection forBut the operational DNSmessage headers. If header bitsviews the leaf nodes in a zone which arefalsely set byalso the apex nodes of aserver, there is little that can be done. However, it is possiblesubzone (i.e., delegation points) as "really" belonging toadd transaction authentication. Such authentication means thatthe subzone. These nodes occur in two master files and will have RRs signed by both the upper and lower zone's keys. A retrieval could get aresolver canmixture of these RRs and SIGs, especially since one server could besure it is getting messages fromserving both theserver it thinks it queriedzone above andthatbelow a delegation point. In general, theresponse isKEY RR from thequery it sent and that these messages have not been diddled in transit. Thissuperzone isaccomplished by optionally adding a special SIG resource record toauthoritative while for all other RRs, theend ofdata from thereply which digitally signssubzone is more authoritative. To avoid conflicts, only theconcatenation ofKEY RR in theserver's responsesuperzone should be signed and theresolver's query. The private key used belongs toNS and any A (glue) RRs should only be signed in thehost composingsubzone along with thereply, not toSOA and any other RRs that have the zonebeing queried.name as owner. Thecorresponding public keyonly exception isstored inthe NXT RR type that will always appear differently andretrieved fromauthoritatively in both theDNS. Because repliessuperzone and subzone, if both arehighly variable, message authentication SIGs can not be pre-calculated. Thus it will be necessary to keep the private key on-line, for example in software orsecure, as described ina directly connected piece of hardware. DNS level transaction authentication would be unnecessary if a lower level (i.e., IP level) end-to-end security protocol were available. However, such a protocol is not yet standardized and when it is, there will be a considerable time during which there will be systems on which it will be hard to add IPSEC but relatively easy to replace the DNS components. Eastlake, Kaufman [Page 9] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 3. The KEY Resource Record The KEY RRSection 5. 2.3.5 Special Considerations with CNAME RRs There isused to documentakey that is associatedsignificant problem with security related RRs witha DNS name. It will be a public key as only public keys are stored in the DNS. This can bethepublic key of a zone owner, of a host or other end entity, orsame owner name as auser. A KEYCNAME RRis, like any other RR, authenticated bywhen retrieved from aSIG RR. Securitynon-security- awareDNS implementations should be designed to handle at least two simultaneously valid keys ofserver. In particular, an initial retrieval for thesameCNAME or any other type will not retrieve an associatedwith a name. Thesignature, key, or NXT RR. For types other than CNAME it will retrieve that typenumber forat theKEY RR is 25. 3.1 KEY RDATA format The RDATA for a KEY RR consiststarget name ofan object name, flags,thealgorithm version,CNAME (or chain of CNAMEs) and will return thepublicCNAME as additional info. In particular, a specific retrieval for type SIG will not get the SIG, if any, at the original domain name but rather an SIG at the target name. In general, security aware servers must be used to securely CNAME in DNS. Security aware servers must (1) allow KEY, SIG, and NXT RRs along with CNAME RRs, (2) suppress CNAME processing on retrieval of these types as well as on retrieval of the type CNAME, and (3) automatically return SIG RRs authenticating the CNAME or CNAMEs encountered in resolving a query. 2.3.6 Signers Other Than The Zone There are two cases where a SIG resource record is signed by other than the zone private key. One is for future support of dynamic update where an entity is permitted to authenticate/update its own records. The public key of the entity must be present in the DNS and Eastlake, Kaufman [Page 9] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 be appropriately signed but the other RR(s) may be signed with the entity's key. The other is for support of transaction authentication as described in Section 2.4 below. 2.4 DNS Transaction Authentication The data origin authentication service described above protects resource records but provides no protection for DNS message headers. If header bits are falsely set by a server, there is little that can be done. However, it is possible to add transaction authentication. Such authentication means that a resolver can be sure it is at least getting messages from the server it thinks it queried, that the response is from the query it sent, and that these messages have not been diddled in transit. This is accomplished by optionally adding a special SIG resource record to the end of the reply which digitally signs the concatenation of the server's response and the resolver's query. The private key used belongs to the host composing the reply, not to the zone being queried. The corresponding public key is stored in and retrieved from the DNS. Because replies are highly variable, message authentication SIGs can not be pre-calculated. Thus it will be necessary to keep the private key on-line, for example in software or in a directly connected piece of hardware. DNS level transaction authentication would be unnecessary if a lower level (i.e., IP level) end-to-end security protocol were available. However, such a protocol is not yet standardized and when it is, there will be a significant time during which there will be systems on which it will be hard to add such a protocol but relatively easy to replace the DNS components. Eastlake, Kaufman [Page 10] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 3. The KEY Resource Record The KEY resource record (RR) is used to document a key that is associated with a Domain Name System (DNS) name. It will be a public key as only public keys are stored in the DNS. This can be the public key of a zone, of a host or other end entity, or a user. A KEY RR is, like any other RR, authenticated by a SIG RR. Security aware DNS implementations MUST be designed to handle at least two simultaneously valid keys of the same type associated with a name. The type number for the KEY RR is 25. 3.1 KEY RDATA format The RDATA for a KEY RR consists of flags, a protocol octet, the algorithm number, and the public key itself. The format is as follows: 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | flags | protocol | algorithm | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / / public key / / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| The meaning of the KEY RR owner name, flags, and protocol octet are described in Sections 3.2, 3.3 and 3.4 below respectively. The flags and protocol must be examined before any following data as they control the format and even whether there is any following data. The algorithm and public key fields are described in Section 3.5. The format of the public key is algorithm dependent. 3.2 Object Types, DNS Names, and Keys The public key in a KEY RR belongs to the object named in the owner name. This DNS name may refer to up to three different things. For example, dee.cybercash.com could be (1) a zone, (2) a host or other end entity , and (3) the mapping into a DNS name of the user or account dee@cybercash.com . Thus, there are flags in the KEY RR to indicate with which of these roles the owner name and public key are associated as described below. Eastlake, Kaufman [Page 11] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 Although the same name can be used for up to all three of these contexts, such overloading of a name is discouraged. It is also possible to use the same key for different things with the same name or even different names, but this is strongly discouraged. In particular, the use of a zone key as a non-zone key will usually require that the private key be kept on line and thereby become much more vulnerable. It would be desirable for the growth of DNS to be managed so that additional possible simultaneous uses for names are NOT added. New uses should be distinguished by exclusive domains. For example, all IP autonomous system numbers have been mapped into the in-as.arpa domain [draft-ietf-dnssec-as-map-*.txt] and all telephone numbers in the world have been mapped into the tpc.int domain [RFC 1530]. This is much preferable to having the same name possibly be an autonomous system number, telephone number, and/or host as well as a zone and a user. In addition to the name type bits, there are additional control bits, the "no key" bit, the "experimental" bit, the "signatory" field, etc., as described below. 3.3 The KEY RR Flag Field In the "flags" field: Bit 0 is the "no key" bit. If this bit is on, there is no key information and the RR stops after the algorithm octet. By the use of this bit, a signed KEY RR can authenticatably assert that, for example, a zone is not secured. Bit 1 is the "experimental" bit. It is ignored if the "no key" bit is on and the following description assumes the "no key" bit to be off. Keys may be associated with zones, entities, or users for experimental, trial, or optional use, in which case this bit will be one. If this bit is a zero, it means that the use or availability of security based on the key is "mandatory". Thus, if this bit is off for a zone key, the zone should be assumed secured by SIG RRs and any responses indicating the zone is not secured should be considered bogus. If this bit is a one for a host or end entity, it might sometimes operate in a secure mode and at other times operate without security. The experimental bit, like all other aspects of the KEY RR, is only effective if the KEY RR is appropriately signed by a SIG RR. The experimental bit must be zero for safe secure operation and should only be a one for a minimal transition period. Bits 2-4 are reserved and must be zero. Eastlake, Kaufman [Page 12] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 Bit 5 on indicates that this is a keyitself.associated with a "user" or "account" at an end entity, usually a host. Theformatcoding of the owner name is that used for the responsible individual mailbox in the SOA record: The owner name is the user name asfollows: 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / +- objectthe name of a node under the entity name. For example, "j.random_user" on host.subdomain.domain could have a public key associated through a KEY RR with name j\.random_user.host.subdomain.domain. It could be used in an security protocol where authentication of a user was desired. This key would be useful in IP or other security for a user level service such a telnet, ftp, rlogin, etc. Bit 6 on indicates that this is a key associated with the non- zone "entity" whose name+---------------+---------------+ / | flags | algorithm | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / + -is the RR owner name. This will commonly be a host but could, in some parts of the DNS tree, be some other type of entity such as an Autonomous System [draft-ietf-dnssec-as-map- *.txt]. This is the public key/ / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-/ The object name, and the flags octets are describedused inSections 3.2 and 3.3 below respectively. The flags mustconnection with the optional DNS transaction authentication service that can beexamined before any following dataused if the owner name is a DNS server host. It could also be used in an IP-security protocol where authentication of a host was desired such asthey controlrouting, NTP, etc. Bit 7 is theformat"zone" bit andeven whether thereindicates that this isany following data. The algorithm anda zone key for the zone whose name is the KEY RR owner name. This is the fundamental type of DNS data origin authentication public key. Bits 8 is reserved to be the "IPSEC" bit and indicate that this keyfields are describedis valid for use inSection 3.4.a future IP level security protocol. This key could be used in connection with secured communication on behalf of an end entity or user whose name is the owner name of the KEY RR if the entity or user bits are on. Theformatpresence of a KEY resource with thepublic key is algorithm dependent. 3.2 Object TypesIPSEC andDNS Namesentity bits on and experimental andKeys The public key inno-key bits off is aKEY RR belongs toguarantee that theobject named inhost speaks IPSEC. Bits 9-11 are reserved and must be zero. Bits 12-15 are theobject name"signatory" field.Frequently this will also beIf non-zero, it indicates that theowner namekey can validly sign RRs of theKEY RR. But they will be different in the case ofsame name. If thekey or keys stored underowner name is azone'swildcard, then RRs with any nameforwhich is in thezone's superzone or keys thatwildcard's scope can be signed. Fifteen different non-zero values arestoredpossible forcross certification ofthis field and any differences in their meaning are reserved for definition in connection with possible future DNS dynamic update or otherzones. Thenew DNSobject name may refer to upcommands. This field is meaningless for zone keys which always have authority tothree different things. Forsign any RRs in the zone. The signatory field, like all other aspects of the KEY RR, is only effective if the KEY RR is appropriately signed by a SIG RR. Eastlake, Kaufman [Page10]13] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995example, dee.lkg.dec.com could3.4 The Protocol Octet It is anticipated that keys stored in DNS will be(1) a zone, (2) a host orused in conjunction with Internet protocols otherend entity , and (3) the mapping into athan DNSname of the user or account dee@lkg.dec.com . Thus, there are flags in the KEY RR to indicate(keys withwhich of these roles the object name and public key are associated as described below. Although the same name can be used for upzone bit or signatory field non-zero) and IPSEC (keys with IPSEC bit set). The protocol octet is provided toall three of these contexts, such overloading ofindicate that aname is discouraged. Itkey isalso possible tovalid for such usethe same keyand, fordifferent things with the same nameend entity keys oreven different names, but this is strongly discouraged. In particular,theusehost part ofa zone key as a non-zone key will usually requireuser keys, that theprivate key be kept on line and thereby become much more vulnerable. It would be desirable for the growthsecure version ofDNS to be managed sothatadditional possible simultaneous uses for namesprotocol is implemented on that entity or host. Values between 1 and 191 decimal inclusive areNOT added. New uses should be distinguishedavailable for assignment byexclusive domains. For example, all IP autonomous system numbers have been mapped into the in-as.arpa domain [draft-ietf-dnssec-as-map-*.txt]IANA for such protocols. The 63 values between 192 andall telephone numbers in the world have been mapped into the tpc.int domain [RFC 1530]. This is much preferable to having the same name possibly254 inclusive will not bean autonomous system number, telephone number, and/or host as well asassigned to azonespecific protocol anda user. In addition to the name type bits, therearethree control bits, the "no key" bit, the "experimental" bit, andavailable for experimental use under bilateral agreement. Value 0 indicates, for a particular key, that it is not valid for any particular additional protocol beyond those indicated in the"signatory" bit, as described below. 3.3 The KEY RR Flag Octet Inflag field. And value 255 indicates that the"flags" field: Bit 0key is valid for all assigned protocols (those in the"no key" bit. If this bit is on, there1 to 191 range). It isno key informationintended that new uses of DNS stored keys would initially be implemented, and operational experience gained, using theRR stops withexperimental range of theflagsprotocol octet.By the use of this bit, a signed KEY RR can authenticatably assert that,If demand forexample,widespread deployment for the indefinite future warrants, azone is not secured. Bits 1 isvalue in the"experimental" bit. Keys mayassigned range would then beassociated with zones, entities, or usersdesignated forexperimental, trial, or optional use,the protocol. Finally, (1) should the protocol become so widespread in conjunction with other protocols whichcase thisare indicated via the protocol octet and with which it shares key values that duplicate RRs are a serious burden and (2) should the protocol provide substantial facilities not available in any protocol for which a flags field bitwill be one. If thishas been allocated, then a flag field bitismay be allocated to the protocol. Then azero, it meanskey can be simultaneously indicated as valid for that protocol and theuseentity oravailability of security based onhost can be simultaneously flagged as implementing thekey is "mandatory". Thus, if this bit is offsecure version of that protocol, along with other protocols fora zone,which flag field bits have been assigned. Note that thezone shouldIPSEC protocol being developed may provide facilities adequate for all point to point IP communication meaning that additional flag field bits would only beassumed secured by SIG RRs and any responses indicatingassigned, when appropriate as indicated above, to protocols with a store-and-forward nature (other than DNS) or otherwise not subsumed into a point-to-point paradigm. 3.5 The KEY Algorithm Number and thezoneMD5/RSA Algorithm This octet isnot secured should be considered bogus. Similarly, if this bit were off for a hostthe keyand attemptsalgorithm parallel tonegotiate IP-security withthehost produced indications that IP-security was not supported, it should be assumed thatsame field for thehost has been compromised or communications with itSIG resource. The MD5/RSA algorithm described in this draft is number 1. Numbers 2 through 253 arebeing spoofed. Onavailable for assignment should sufficient reason arise. However, theother hand, if thisdesignation of a new algorithm Eastlake, Kaufman [Page11]14] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995bit werecould have a major impact on interoperability and requires an IETF standards action. Number 254 is reserved for private use and will never be assigned aone,specific algorithm. For number 254, thehost might very well sometimes operatepublic key area shown ina secure modethe packet diagram above will actually begin with an Object Identifier (OID) indicating the private algorithm in use andat other times operate withouttheavailability of IP-security. The experimental bit, like all other aspectsremainder of theKEY RR,area isonly effective if the KEY RRwhatever isappropriately signedrequired bya SIG RR. The experimentalthat algorithm. Values 0 and 255 are reserved. If the no key bitmust beis zerofor safe secure operationandshould only be a one for a minimal transition period. Bitthe algorithm field is 1, indicating the MD5/RSA algorithm, the public key field is structured as follows: 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2is the "signatory" bit. It indicates that the3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | pub exp length| public keycan validly sign RRs of the same name. If the owner name is a wildcard, then RRs with any name which is inexponent / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / +- modulus / | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-/ To promote interoperability, thewildcard's scope can be signed including NSexponent andcorresponding zone KEY RRs to carve out a subzone. This bit is meaningless for zone keys which always have authoritymodulus are limited tosign any RRs2552 bits inthe zone.length. Thesignatory bit, like all other aspects of the KEY RR,public key exponent isonly effectivea variable length unsigned integer. Its length in octets is represented as one octet ifthe KEY RRit isappropriately signedin the range of 1 to 255 and by aSIG RR. Bits 3-4 are reserved and must be zero. If they are found non- zero, they should be ignored and the KEY RR used as indicatedzero octet followed bythe other flags. Bit 5 on indicates that this isa two octet unsigned length if it is longer than 255 bytes. The public keyassociated with a "user" or "account" at an end entity, usuallymodulus field is ahost.multiprecision unsigned integer. Thecodinglength of theowner name is that used formodulus can be determined from theresponsible individual mailboxRDLENGTH and the preceding RDATA fields including the exponent. Leading zero bytes are prohibited in theSOA record: The owner name isexponent and modulus. 3.6 Interaction of Flags, Algorithm, and Protocol Bytes Various combinations of theuser nameno-key bit, algorithm byte, protocol byte, and any protocol indicating flags (such as thename of a node underreserved IPSEC flag) are possible. (Not that theentity name. For example, "j.random_user"zone flag bit being onhost.subdomain.domain could have a public key associated throughor the signatory field being non-zero is effectively aKEY RR with name j\.random_user.host.subdomain.domain. It could be used in an IP-securityDNS protocolwhere authenticationflag on.) The meaning ofa user was desired. Thisthese combinations is indicated below: NK = no keywould be useful in IPflag AL = alogrithm byte PR = protocols indicated by protocol byte orother security for a user level service such a telnet, ftp, rlogin, etc. Bit 6 on indicates that this is aprotocol flags x represents any valid non-zero value. AL PR NK Meaning 0 0 0 Illegal, claims keyassociated with the non- zone entity whose name is the RR owner name. This will commonly be a hostbutcould, in some partshas bad algorithm field. 0 0 1 Authenticates total lack ofthesecurity for owner. Eastlake, Kaufman [Page 15] INTERNET-DRAFT DNStree,Protocol Security Extensions 25 June 1995 0 x 0 Illegal, claims key but has bad algorithm field. 0 x 1 Specified protocols insecure, others may besome other type of entity such as an Autonomous System [draft-ietf-dnssec-as-map-*.txt]. This is the publicsecure. x 0 0 Useless. Gives keyused in connectionbut no protocols to use it. x 0 1 Useless. Denies key but for no protocols. x x 0 Authenticates key for protocols and certifies that those protocols are implemented with security. x x 1 Algorithm not understood for protocol. (remember, in reference to theoptional DNS transaction authentication serviceabove table, thatcan be used ifa protocol byte of 255 means all protocols with protocol bytes assigned) 3.7 KEY RRs in theowner name isConstruction of Responses An explicit request for KEY RRs does not cause any special additional information processing except, of course, for the corresponding SIG RR from a security aware server. Security aware DNSserver host. It could also be usedservers will include KEY RRs as additional information inan IP-security protocolresponses whereauthenticationappropriate including the following: (1) On the retrieval ofa host was desired. Bit 7 on indicates that this is aNS RRs, the zone key KEY RR(s) for the zonewhoseserved by these nameisservers will be included as additional information. If not all additional info will fit, the KEYRR owner name. This is the fundamentalRR(s) have higher priority than type A (or AAAA) glue RRs. (2) On retrieval ofDNStype A (or AAAA) RRs, the end entity KEY RR(s) will be included. On inclusion of A (or AAAA) RRs as additional information, their KEY RRs will also be included but with lower priority than the relevant A (or AAAA) RRs. 3.8 File Representation of KEY RRs KEY RRs may appear as lines in a zone dataorigin authentication public key. 3.4file. TheKEY Algorithm Versionflag field, protocol, andMD5/RSA Algorithm This octetalgorithm number octets are then represented as unsigned integers. Note that if the "no key" flag is on in the flags, nothing appears after thekeyalgorithmversion paralleloctet. The remaining public key portion is represented in base 64 (see Appendix) and may be divided up into any number of white space separated substrings, down to single base 64 digits, which are concatenated to obtain thesame field forfull signature. These substrings can span lines using the standard parenthesis. Note that theSIG resource. The MD5/RSA algorithm described in this draftpublic key may have internal sub-fields but these do Eastlake, Kaufman [Page12]16] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995is number 1. Version numbers 2 through 253 are available for assignment should sufficient reason arise. However,not appear in thedesignation of a new version could have a major impact on interoperability and requires an IETF standards action. Version 254master file representation. For example, with algorithm 1 there isreserved for private usea public exponent andwill never be assignedthen aspecific algorithm. For versionmodulus and with algorithm 254,the public key area shown in the packet diagram abovethere willactually begin withbe anObject Identifier (OID) indicating the privateOID followed by algorithm dependent information. Eastlake, Kaufman [Page 17] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 4. The SIG Resource Record The SIG or "signature" resource record (RR) is the fundamental way that data is authenticated inuse andtheremaindersecure Domain Name System (DNS). As such it is the heart of thecombined area is whatever is required by that algorithm. Algorithm versions 0security provided. The SIG RR unforgably authenticates other RRs of a particular type, class, and name and binds them to a time interval and255 are reserved. Iftheno key bitsigner's domain name. This iszerodone using cryptographic techniques and thealgorithm fieldsigner's private key. The signer is1, indicatingfrequently theMD5/RSA algorithm,owner of thepublic key filedzone from which the RR originated. 4.1 SIG RDATA Format The RDATA portion of a SIG RR isstructuredasfollows:shown below. The integrity of the RDATA information is protected by the signature field. 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 67 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | public key exponent |modulus length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / +- modulus / | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The public key modulus field is a multiprecision unsigned integer. The "modulus length" is an unsigned octet which is the actual modulus length minus 64. This limits keys to a maximum of 255+64 or 319 octets and a minimum of 64 octets. Although moduluses of less than 512 significant bits are not permitted, due to the weak security they provide, they can be represented by using leading zeros. 3.5 KEY RRs in the Construction of Responses An explicit request for KEY RRs does not cause any special additional information processing except, of course, for the corresponding SIG RR from a security aware server. Security aware DNS servers will include KEY RRs as additional information in responses where appropriate including the following: On the retrieval of NS RRs, the zone key KEY RR(s) for the zone served by these name servers will be included. If not all additional info will fit, the KEY RR(s) have lower priority than type A or AAAA glue RRs. On retrieval of type A or AAAA RRs, the end entity KEY RR(s) will be included. On inclusion of A or AAAA RRs as additional information, their KEY RRs will also be included but with lower Eastlake, Kaufman [Page 13] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 priority than the relevant A or AAAA RRs. 3.6 File Representation of KEY RRs KEY RRs may appear as lines in a zone data file. In the RDATA portion, the object7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type covered | algorithm | labels | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | original TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | signature expiration | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | time signed | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | key footprint | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ signer's nameappears first./ / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | / +- signature / / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Theflag octet and algorithm version octets are then represented as unsigned integers; however, ifvalue of the"no key" flagSIG RR type ison in the flags, nothing appears after the flag octet. If the algorithm specified24. The "type covered" is theMD5/RSA algorithm, thentype of theexponent and modulus appear.other RRs covered by this SIG. Thepublic key exponentalgorithm number is anunsigned integer from 3 to 16777215. The public key modulus can be quite large, up to 319 octets. It isoctet specifying thelast data field and is represented in base 64 (see Appendix) and may be divided up into any number of white space separated substrings, down to single base 64 digits, which are concatenateddigital signature algorithm used parallel toobtainthefull signature. These substrings can span lines usingalgorithm octet for thestandard parenthesis. If anKEY RR. The MD5/RSA algorithmfromdescribed in this draft is number 1. Numbers 2 through 253is specified, the public key parameters required by that algorithmaregiven. Ifavailable for assignment should sufficient reason arise to allocate them. However, the designation of a new algorithmspecified is number 254, thencould have a major impact on the interoperability of the global DNS systems and requires anOID appears followed by whateverIETF standards action. Number 254 isrequiredEastlake, Kaufman [Page 18] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 reserved fortheprivatealgorithm. An implementation that doesuse and will notunderstandbe assigned aparticular standard orspecific algorithm. For number 254, the "signature" area shown above will actually begin with an Object Identifier (OID) indicating the private algorithmshould attempt to parsein use and therestremainder of theline as one or more base 64 substrings to be concatenated to yield the key parameters. Algorithm versionssignature area is whatever is required by that algorithm. Values 0 and 255 are reserved.Eastlake, Kaufman [Page 14] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 4. The SIG Resource RecordThe "labels" octet is an unsigned count of how many labels there are in the original SIGor "signature" resource record (RR)RR owner name not counting the null label for root and not counting any initial "*" for a wildcard. If a secured retrieval is thefundamental way that dataresult of wild card substitution, it isauthenticatednecessary for the resolver to use the original form of the name in verifying thesecure DNS. As suchdigital signature. This field helps optimize the determination of the original form reducing the effort in authenticating signed data. If, on retrieval, the RR appears to have a longer name than indicated by "labels", the resolver can tell it is theheartresult of wildcard substitution. If thesecurity provided. The SIGRRunforgably authenticates other RRs of a particular type, class, andowner nameand binds themappears toa time intervalbe shorter than the labels count, the SIG RR should be considered corrupt and ignored. The maximum number of labels possible in the current DNS is 127 but thesigner's fully qualified domain name. Thisentire octet isdone using cryptographic techniquesreserved andthe signer's private key.would be required should DNS names ever be expanded to 255 labels. Thesignerfollowing table give some examples. The value of "labels" isfrequentlyat theowner oftop, thezone from whichretrieved owner name on theRR originated. 4.1 SIG RDATA Format The RDATA portion of a SIG RR is as shown below. The integrity ofleft, and theRDATA informationtable entry isprotected bythe name to use in signaturefield. 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9verification except that "bad" means the RR is corrupt. labels= | 0 | 1 | 2 | 3 | 45 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|type covered--------+-----+------+--------+----------+----------+ .| . |algorithmbad |labelsbad |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+bad |original TTLbad |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+d.| *. |signature expirationd. |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+bad |time signedbad |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+bad |key footprintc.d.| *. |/ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ signer's name / / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*.d. |/ +-c.d. | bad | bad | b.c.d.| *. | *.d. | *.c.d. | b.c.d. | bad | a.b.c.d.| *. | *.d. | *.c.d. | *.b.c.d. | a.b.c.d. | The "original TTL" field is included in the RDATA portion to avoid (1) authentication problems that caching servers would otherwise cause by decrementing the real TTL field and (2) security problems that unscrupulous servers could otherwise cause by manipulating the real TTL field. This original TTL is protected by the signature/ / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The value ofwhile theSIG RR typecurrent TTL field is24.not. NOTE: The"type covered" is the type of"original TTL" must be restored into theother RRscoveredby this SIG. The algorithm version number is an octet specifyingRRs when thedigitalsignaturealgorithm used. The MD5/RSA algorithm described in this draftisversion 1. Version numbers 2 through 253 are available for assignment should sufficient reason arise to allocate them. However,verified. This implies that thedesignation ofRRs for anew version couldparticular type need to all havea major impact ontheinteroperability ofsame TTL to start with. The SIG is valid until theglobal DNS systems and requires"signature expiration" time which is anIETF standards action. Version 254unsigned number of seconds since the start of 1 January 1970, GMT, ignoring leap seconds. (See also Section 4.4.) The "time signed" field isreserved for private use and willan unsigned number of seconds since the Eastlake, Kaufman [Page15]19] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995never be assigned a specific algorithm. For version 254, the "signature" area shown above will actually begin with an Object Identified (OID) indicating the private algorithm in use and the remainderstart ofthe signature area is whatever1 January 1970, GMT, ignoring leap seconds. The "key footprint" isrequired bya 16 bit quantity thatalgorithm. Version numbers 0 and 255 are reserved. The "labels" octetisan unsigned count of how many labels there are in the original SIG RR owner name not counting the null label for rootused to help efficiently select between multiple keys which may be applicable andnot counting any initial "*" foras awildcard. If, on retrieval,quick check that a public key about to be used for theRR appearscomputationally expensive effort tohave a longer name,check theresolver can tellsignature is possibly valid. Its exact meaning is algorithm dependent. For the MD5/RSA algorithm, it is theresultnext to the bottom two octets ofwildcard substitution. IftheRR owner name appearspublic key modulus needed tobe shorter thandecode thelabels count,signature field. That is to say, theSIG RR should be considered corrupt and ignored. The maximum numbermost significant 16 oflabels possible inthecurrent DNSlest significant 24 bits of this quantity in network order. The "signer's name" field is127 buttheentire octetdomain name of the signer generating the SIG RR. This isreserved and wouldfrequently the zone which contained the RR(s) being authenticated. The signer's name may berequired shouldcompressed with standard DNSnames ever be expanded to 255 labels. If a secured retrieval isname compression when being transmitted over theresultnetwork. The structure ofwild card substitution, itthe "signature" field isnecessary fordescribed below. 4.1.1 Signature Data The actual signature portion of theresolver to useSIG RR binds theoriginal formother RDATA fields to all of thename in verifying"type covered" RRs with that owner name. These covered RRs are thereby authenticated. To accomplish this, a data sequence is constructed as follows: data = RDATA | RR(s)... where | is concatenation, RDATA is all thedigital signature. The field helps optimizeRDATA fields in thedetermination ofSIG RR itself before theoriginal form reducingsignature, and RR(s) are all theeffort in authentication signed data. The following table give some examples. The valueRR(s) of"labels" is atthetop,type covered with theretrievedsame owner nameonand class as theleft,SIG RR in canonical form and order. For purposes of DNS security, thetable entrycanonical form for an RR is the RR with domain names (1) fully expanded (no name compression via pointers) and (2) all domain name letters set touselower case. For purposes of DNS security, the canonical order for RRs is to sort them insignature verification exceptascending order by name, then by type, as left justified unsigned octet sequences in network (transmission) order where a missing octet sorts before a zero octet. (See also ordering discussion in Section 5.1.) Within any particular name and type they are similarly sorted by RDATA as a left justified unsigned octet sequence. EXCEPT that"bad" meanstheRRtype SIG RR(s) covering any particular type appear immediately after the other RRs of that type. Thus if at name a.b there iscorrupt. labels= | 0 | 1 | 2 | 3 | 4 | --------+-----+------+--------+----------+----------+ .| . | bad | bad | bad | bad | d.| *. | d. | bad | bad | bad | c.d.| *. | *.d. | c.d. | bad | bad | b.c.d.| *. | *.d. | *.c.d. | b.c.d. | bad | a.b.c.d.| *. | *.d. | *.c.d.one A RR and one KEY RR, their order with SIGs for concatenating the "data" to be signed would be as follows: Eastlake, Kaufman [Page 20] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 a.b. A .... a.b. SIG A ... a.b. KEY ... a.b. SIG KEY ... (SIGs on type ANY should not be included in a zone.) How this data sequence is processed into the signature is algorithm dependent. 4.1.2 MD5/RSA Algorithm Signature Calculation For the MD5/RSA algorithm, the signature is as follows hash = MD5 ( data ) signature = ( 01 |*.b.c.d.FF* |a.b.c.d.00 |The "original TTL" fieldhash ) ** e (mod n) where MD5 isincludedthe message digest algorithm documented in RFC 1321, "|" is concatenation, "e" is theRDATA portion to avoid authentication problems that caching servers would otherwise cause by decrementingsecret key exponent of thereal TTL fieldsigner, andsecurity problems that unscrupulous servers could otherwise cause by manipulating the real TTL field. This original TTL"n" isprotected by the signature whilethecurrent TTL field is not. NOTE: The "original TTL" must be restored intopublic modulus of thecovered RRs whensigner's public key. 01, FF, and 00 are fixed octets of thesignaturecorresponding hexadecimal value. The FF octet isverified. This impliesrepeated the maximum number of times such that theRRs need to all havevalue of thesame TTL to start with. The SIGquantity being exponentiated isvalid untilone octet shorter than the"signature expiration" time whichvalue of n. The size of n, including most and least significant bits (which will be 1) SHALL be not less than 512 bits and not more than 2552 bits. n and e SHOULD be chosen such that the public exponent isan unsigned numbersmall. Leading zeros bytes are not permitted in the MD5/RSA algorithm signature. The above specifications are similar to Public Key Cryptographic Standard #1 [PKCS1]. A public exponent ofseconds since3 minimizes thestarteffort needed to decode a signature. Use of1 January 1970, GMT. The "time signed" field is3 as the public exponent may be weak for confidentiality uses since, if the same data can be collected encrypted under three different keys with anunsigned numberexponent ofseconds since3 then, using thestart of 1 January 1970, GMT. The "key footprint" is a 16 bit quantity thatChinese Remainder Theorem, the original plain text can be easily recovered. This weakness isused to helpnot significant for DNS because we seek only authentication, not confidentiality. Eastlake, Kaufman [Page16]21] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 4.1.3 Zone Transfer (AXFR) SIG The above SIG mechanisms assure the authentication of all zone signed RRs of a particular name, class and type. However, to efficientlyselect between multiple keys which maysecure complete zone transfers, a SIG RR owned by the zone name must beapplicable and ascreated with aquick checktype covered of AXFR thata public key about tocovers all zone signed RRs other than the SIG AXFR itself. It will beusedcalculated by hashing together all other static zone RRs, including SIGs. The RRs are ordered and concatenated forthe computationally expensive effort to check the signature is possibly valid. Its exact meaning is algorithm dependent. For the MD5/RSA algorithm, it is the next to the bottom two octetshashing as described in Section 4.1.1. (See also ordering discussion in Section 5.1.) The AXFR SIG must be calculated last ofthe publicall zone keymodulus neededsigned SIGs in the zone. It really belongs todecodethesignature field. That iszone as a whole, not tosay, the most significant 16 ofthelest significant 24 bits of this quantity in network order.zone name. The"signer's name" fieldAXFR SIG isthe fully qualified domain nameonly retrieved as part of a zone transfer. After validation of thesigner generating the SIG RR. This is frequentlyAXFR SIG, the zonewhich contained the RR(s) being authenticated. The structuredmay be considered valid without verification of all the"signature" field depends oninternal zone SIGs in thealgorithm chosen and is described below forzone; however, any SIGs signed by entity keys or theMD5/RSA algorithm. 4.1.1 Signature Formatlike must still be validated. Theactual signature portion of theAXFR SIGRR binds RDATA to all ofis transmitted first in a zone transfer so the"type covered" RRs withreceiver can tell immediately thatowner name. These coveredthey may be able to avoid verifying other zone signed SIGs. Dynamic zone RRsare thereby authenticated. To accomplish this, a data sequence is constructed as follows: data = RDATA | RR(s)... where | is concatenationwhich might be added by some future dynamic zone update protocol andRR(s)signed by an end entity or user key rather than a zone key (see Section 3.2) areallnot included. They originate in theexpanded (no name abbreviation) RR(s) ofnetwork and will not, in general, be migrated to thetype covered withrecommended off line zone signing procedure (see Section 8.2). Thus such dynamic RRs are not directly signed by thesame owner namezone, are not included in the AXFR SIG, andclassare not generally protected against omission during zone transfers. 4.1.4 Transaction SIGs A response message from a security aware server may optionally contain a special SIG as theSIG RRlast item incanonical order. The canonical order for RRs isthe additional information section tosort them in ascending order as left justified unsigned octet sequences whereauthenticate the transaction. This SIG has amissing octet sorts before"type covered" field of zero, which is not azero octet. How this data sequencevalid RR type. It isprocessed intocalculated by using a "data" (see Section 4.1.2) of thesignature is algorithm dependent. Forentire preceding DNS reply message, including DNS header, concatenated with theMD5/RSA algorithm,entire DNS query message that produced this response, including thesignaturequery's DNS header. That isas follows hash = MD5 (data) signature=( 01 | FF* | 00full response (less trailing message SIG) |hash ) ** e (mod n) where "|" is concatenation, "e" is the secret key exponent of the signer, and "n" is the public modulus that is the signer's public key. 01, FF, and 00 are fixed octets of the corresponding hexadecimal value. The FF octet is repeated the maximum number of times such that the valuefull query Verification of thequantity being exponentiatedtransaction SIG (which isone octet shorter thansigned by thevalue of n. The size of n, including most and least significant bits (which will Eastlake, Kaufman [Page 17] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 be 1) SHALL be not less than 512 bits andserver host key, notmore than 2552 bits. n and e MUST be chosen suchthe zone key) by the requesting resolver shows that thepublic exponent is less than or equal to 2**24 - 1query andSHOULD be chosen suchresponse were not tampered with in transit, that thepublic exponent is small. The above specifications are similarresponse corresponds toPublic Key Cryptographic Standard #1 [PKCS1]. (A public exponent of 3 minimizestheeffort needed to decode a signature. Use of 3 asintended query, and that thepublic exponent may be weak for confidentiality uses since, ifresponse Eastlake, Kaufman [Page 22] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 comes from thesame data can be collected encrypted under three different keys with an exponentqueried server. 4.2 SIG RRs in the Construction of3 then, usingResponses Security aware servers MUST, for every authoritative RR theChinese Remainder Theorem,query will return, attempt to send theoriginal plain text can be easily recovered. This weakness is not significant for DNS because we seek only authentication, not confidentiality.) 4.1.2available SIG RRsCovering Type ANYwhich authenticate the requested RR. TheSIG RR described above protects allfollowing rules apply to the inclusion of SIG RRswith a particular owner name, class, and type. Thus a server must supply them all to convince a security aware resolver. However,in responses: 1. when anunscrupulous server could claim there were no RRs ofRR is placed in aparticular type and class under an owner name while presenting signed RRs of other types. To provideresponse, its SIG RR has a higher priority for inclusion than other RRs that may need to be included. If space does not permit its inclusion, the response MUST be considered truncated. 2. when ameans of protection against this, one or moreSIG RR isaddedpresent foreach owner name that coversan RR to be included in thetype ANY. It is calculated as indicated above except that alladditional information section, the response MUST not be considered truncated if space does not permit the inclusion of the SIG RR. Sending SIGs to authenticate non-authoritative data (glue records and NS RRs forthat owner namesubzones) is unnecessary and must be avoided. Note that KEYs for subzones are authoritative. If a SIGkey, except the SIGcovers any RRcovering type ANY itself, are includedthat would be in thedata string which is processed intoanswer section of thesignature. To allow for dynamic update,response, its automatic inclusion MUST be thezone key signed ANY SIG RRanswer section. If it coversonly zone signed RRs.an RR that would appear in the authority section, its automatic inclusion MUST be in the authority section. IfRRs are added to a zoneit covers an RR that would appear in the additional information section it MUST appear in the additional information section. Optionally, DNS transactions may be authenticated byan entity or user key, then an ANYa SIG RRsigned by that key coveringat the end of the response in the additional information section (Section 4.1.4). Such SIG RRs are signed bythat key shouldthe DNS server originating the response. Although the signer field must beadded. 4.1.3 Zone Transfer (AXFR) SIG The above SIG mechanisms assuretheauthenticationname ofalltheRRs of a particular name, class and type and alloriginating server host, theRRs of a particular name, class and any type. However, to secure complete zone transfers, a SIG RR owned byowner name, class, TTL, and original TTL, are meaningless. The class and TTL fields can be zero. To conserve space, thezoneowner namemustSHOULD becreated with a type covered of AXFRroot (a single zero octet). If transaction authentication is desired, thatcovers all other zone signed RRs. It willSIG RR must becalculated by hashing together allconsidered higher priority than any otherstatic zone RRs, including SIGs. The RRs are ordered and concatenated for hashing as describedRR inSection 4.1.1. This SIG, other than havingthe answer. 4.3 Processing Responses and SIG RRs The following rules apply tobe calculated lastthe processing ofall zone key signed SIGsSIG RRs included inthe zone, is the same as any other SIG.a response: 1. a security aware resolver that receives a response from what it Eastlake, Kaufman [Page18]23] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995Dynamic zone RRs which mightbelieves to beadded by some future dynamic zone update protocol and signed by an end entity or user key rather thanazone keysecurity aware server via a communication path that it believes to be secure with the AD bit (see Section3.2) are not included. They originate6.1) set, MAY choose to accept the RRs as received without verifying the SIG RRs. 2. in other cases, a security aware resolver SHOULD verify the SIG RRs for the RRs of interest. This may involve initiating additional queries for SIG or KEY RRs, at least in the case of getting a response from an insecure server. (As explained in 4.2 above, it will not be possible to secure CNAMEs being served up by old resolvers.) NOTE: Implementors might expect the SHOULD to be a MUST. However, local policy or the calling application may not require thenetwork and will not,security services. 3. If SIG RRs are received ingeneral, be migratedresponse to a user query explicitly specifying therecommended off line zone signing procedure (see Section 8.2). Thus such dynamic RRs areSIG type, no special processing is required. If the message does notdirectlypass reasonable checks or the SIG does not check against the signedbyRRs, thezoneSIG RR is invalid and should be ignored. If all of the SIG RR(s) purporting to authenticate a set of RRs are invalid, then the set of RR(s) is notgenerally protected against omission during zone transfers. 4.1.4 Transaction SIGs A response message from a security aware server may optionally contain a specialauthenticated. If the SIGasRR is the lastitemRR in a response in the additional information sectionto authenticate the transaction. This SIGand has a"type covered" fieldtype covered of zero,which is not a valid RR type. Itit iscalculated by usinga"data" (see section 4.1.1)transaction signature of theentire preceding DNS reply message, including DNS header, concatenated withresponse and theentire DNSquerymessagethat producedthis response, includingthequery's DNS header. That is data = full response (less trailing message SIG) | full query Verification ofresponse. It MAY be optionally checked and the message rejected if the checks fail. But even if the checks succeed, such a transaction authentication SIG(which isdoes NOT authenticate any RRs in the message. Only a proper SIG RR signed by theserver host key, not thezonekey) by the requestingcan authenticate RRs. If a resolvershows that the query and response weredoes nottampered with in transit andimplement transaction SIGs, it MUST at least ignore them without error. If all reasonable checks indicate that theresponse corresponds to the intended query. 4.2SIG RR is valid then RRsin the Construction of Responsesverified by it should be considered authenticated. 4.4 Signature Expiration, TTLs, and Validity Security aware serversMUST, for every authoritative RR the query will return, attempt to send the availablemust not consider SIG RRswhich authenticate the requested RR. If multiple such SIGs are available, there may be insufficient space in the responsetoinclude them all. In this case, SIGs whose signer is the zone containing the RR MUSTbegiven highest priorityauthentic after their expiration time andretained even if SIGs with other signers mustnot consider any RR to bedropped. Sending SIGsauthenticated after its signatures have expired. Within that constraint, servers should continue toauthenticatefollow DNS TTL aging. Thus authoritative servers should continue to follow the zone refresh and expire parameters and a non-authoritativedata (glue recordsserver should count down the TTL andNSdiscard RRsfor subzones)when the TTL isoptional andzero. In addition, when RRs are transmitted in a query response, the TTL should beavoided if it will lead to UDPtrimmed so that current time plus the TTL does not extend beyond the signature Eastlake, Kaufman [Page 24] INTERNET-DRAFT DNSresponse truncation. If a SIG covers anyProtocol Security Extensions 25 June 1995 expiration time. Thus, in general, the TTL on an transmitted RRthatwould bein the answer sectionmin(sigExpTim,max(zoneMinTTL,min(originalTTL,currentTTL))) 4.5 File Representation ofthe response, its automatic inclusion MUSTSIG RRs A SIG RR can bethe answer section. If it covers anrepresented as a single logical line in a zone data file [RFC1033] but there are some special problems as described below. (It does not make sense to include a transaction authenticating SIG RRthat would appear in the authority section, its automatic inclusion MUST beinthe authority section. Ifa file as it is a transient authentication that covers data including anRR that would appear in the additional information sectionephemeral transaction number so itMUST Eastlake, Kaufman [Page 19] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 appear in the additional information section. Optionally, DNS transactions maymust beauthenticatedcalculated in real time bya SIG RR attheend ofDNS server.) There is no particular problem with theresponsesigner, covered type, and times. The time fields appears in theadditional information section (section 4.1.4). Such SIG RRs are signed byform YYYYMMDDHHMMSS where YYYY is theDNS server originatingyear, theresponse. Althoughfirst MM is thesigner field must bemonth number (01-12), DD is thenameday of theoriginating server host,month (01-31), HH is theowner name, class, TTL,hour in 24 hours notation (00-23), the second MM is the minute (00-59), andoriginal TTL, are meaningless.SS is the second (00-59). Theclass andoriginal TTL and algorithm fields appear as unsigned integers. The "labels" field does not appear in the file representation as it can bezero. To save space,calculated from thename shouldowner name. The key footprint appears as an unsigned decimal number. However, the signature itself can beroot (a single zero octet). [Therevery long. It is the last data field and is represented in base 64 (see Appendix) and may bea problem with SIGdivided up into any number of white space separated substrings, down to single base 64 digits, which are concatenated to obtain the full signature. These substrings can be split between lines using the standard parenthesis. Eastlake, Kaufman [Page 25] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 5. Non-existent Names andNXD RR's associated with domain names that are CNAMEs.Types TheDNS RFCs prohibit other typesSIG RR mechanism described in Section 4 above provides strong authentication of RRsappearing withthat exist in aCNAME RR. This problemzone. But isbeing ignored untilitisnot immediately clearif DNS servers will really havehow to authenticatably deny the existence of aproblem with this.] 4.3 Processing Responses with SIG RRs If SIG RRs are receivedname inresponse toaquery explicitly specifying the SIG type, no special processing is required butzone or asecurity aware client MAY wish to authenticate themtype for an existent name. The nonexistence of a name in a zone is indicated bycheckingthesignatureNXT ("next") RR for a name interval containing the nonexistent name. An NXT RR andapplying consistency checks. Ifits SIGRRsarereceivedreturned in the authority section, along with the error, if the server is security aware. The same is true for a non-existent type under an existing name. NXT RRs will also be returned if an explicit query is made for the NXT type. The existence of a complete set of NXT records in a zone means that anyother response,query for any name and type to a security awareclient should check them using the public key ofserver serving thesigner. The resultzone shouldthen be verified against the appropriate otherresult in an reply containing at least one signed RR. NXT RRsretrieved. If the message does not pass reasonable checks or the SIG doesdo notcheck againstappear in zone master files since they can be derived from thesigned RRs,rest of theSIG RRzone. 5.1 The NXT Resource Record The NXT resource record isinvalidused to securely indicate that RRs with an owner name in a certain name interval do not exist in a zone andshould be ignored.to indicate what zone signed type RRs are present for an existing name. Thetime of receiptowner name of theSIGNXT RRmust beis an existing name in theinclusive range of the time signed and the signature expiration but the SIG can be retainedzone. It's RDATA is a "next" name andremains locally valid until the expiration time plus the authenticated TTL. Ifa type bit map. The presence of theSIGNXT RRismeans that generally no name between its owner name and thelast RR in a responsename inthe additional information sectionits RDATA area exists andhasthat no other types exist under its owner name. This implies atype coveredcanonical ordering ofzero, it isall domain names in atransaction signature ofzone. The ordering is to sort labels as unsigned left justified octet strings where the absence of a octet sorts before a zero octet. Names are then sorted by sorting on theresponsehighest level label and then, within those names with thequery that produced the response. It may be optionally checked andsame highest level label by themessage rejected ifnext lower label, etc. Since we are talking about a zone, thechecks fail. But even itzone name itself always exists and all other names are thechecks succeed, such a transaction authentication SIG does NOT authenticate any RRs inzone name with some prefix of lower level labels. Thus themessage. Onlyzone name itself always sorts first. There is aproper SIG RR signets signed byproblem with thezone can authenticate RRs. Iflast NXT in aresolver does not implement transaction SIGs,zone as itMUST at least ignore them without error. If all reasonable checkswants to have an owner name which is the last existing name in sort order, which is easy, but it is not obvious what name to put in its RDATA to indicatethattheSIG RRentire remainder of the name space. This isvalid then RRs verifiedhandled byit should be considered authenticatedtreating the name space as circular andall other RRsputting the zone name in theresponse should be considered with suspicion.RDATA of Eastlake, Kaufman [Page20]26] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 19954.4 File Representation of SIG RRs A SIG RR can be represented as a single logical line in a zone data file [RFC1033] but therethe last NXT. There aresomespecialproblems as described below. (It does not make senseconsiderations due toinclude a transaction authenticating SIG RR in a fileinteraction with wildcards asit isexplained below. The NXT RRs for atransient authentication that mustzone should be automatically calculatedin real time by the DNS server.) There is no particular problem with the signer, covered type,andtimes. The time fields appears in the form YYYYMMDDHHMMSS where YYYY is the year, the first MM is the month number (01-12), DD is the day of the month (01-31), HH is the hour in 24 hours notation (00-23),added to thesecond MM iszone by theminute (00-59), and SS issame recommended off-line process that signs thesecond (00-59).zone. TheoriginalNXT RR's TTLand algorithm fields appears as unsigned integers. The "labels" field doesshould notappear inexceed thefile representation as itzone minimum TTL. 5.2 NXT RDATA Format The RDATA for an NXT RR consists simply of a domain name followed by a bit map. The type number for the NXT RR is 30. 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | next domain name / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | type bit map / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The size of the bit map can becalculatedinferred from theownerRDLENGTH and the length of the next domain name.The key footprint appears as5.3 Example Assume zone foo.bar has entries for big.foo.bar, medium.foo.bar. small.foo.bar. tiny.foo.bar. Then a query to a security aware server for huge.foo.bar would produce aneight digit unsigned hexadecimal number. However, the signature itself can be very long. It iserror reply with thelastauthority section datafield andincluding the following: big.foo.bar. NXT medium.foo.bar. 130 big.foo.bar. SIG NXT ... Note that this response implies that big.foo.bar isrepresentedan existing name inbase 64 (see Appendix) and may be divided up into any number of white space separated substrings, down to single base 64 digits, which are concatenated to obtainthefull signature. These substrings can be split between lines usingzone and thus has other RR types associated with it than NXT. However, only thestandard parenthesis.NXT (and its SIG) RR appear in the response to this Eastlake, Kaufman [Page21]27] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 19955. Non-existent Names The SIG RR mechanism described in section 4 above provides strong authenticationquery for huge.foo.bar, which is a non-existent name. 5.4 Interaction of NXT RRsthat existand Wildcard RRs Since, in some sense, azone. But is it not immediately clear howwildcard RR causes all possible names in an interval toauthenticatably deny the existenceexist, there should not be an NXT RR that would cover any part ofathis interval. Thus if *.X.ZONE exists you would expect an NXT RR that ends at X.ZONE and one that starts with the last namein a zone. The nonexistence of acovered by *.X.ZONE. However, this "last namein a zonecovered" isindicated bysomething very ugly and long like \255\255\255....X.zone. So theNXD RRNXT fora name interval containing the nonexistent name. An NXD RR and its SIG are returned intheadditional information section, along withinterval following is simply given theerror, ifowner name *.X.ZONE. This "*" type name is not expanded when theresolverNXT issecurity aware. NXD RRs can also bereturnedif an explicit query is made for the NXD type. The existence of a complete set of NXD recordsas authority information in connection with azone means that anyquery for a non-existent name. If there could be anyname towildcard RRs in asecurity aware server serving thezoneshould result in an reply containing at least one signed RR. 5.1 The NXD Resource Record The NXD resource record is used to securely indicate that no RRs with anand thus wildcard NXTs, care must be taken in interpreting the results of explicit NXT retrievals as the owner nameinmay be a wildcard expansion. The existence of one or more wildcard RRs covering acertainname intervalexist inmakes it possible for azone.malicious server to hide any more specificly named RRs in the internal. Theowner nameserver can just falsely return the wildcard match NXT instead of theNXD RRmore specificly named RRs. If there is a zone wide wildcard, there will be anexistingNXT RR whose owner nameinis thezone. It'swild card and whose RDATA isanother existing name inthezone. The presencezone name. In this case a server could conceal the existence of any more specific RRs in theNXD RR meanszone. (It would be possible to design a more strict NXT feature which would eliminate this possibility. But it would be more complex and might be so constraining as to make any future dynamic update feature thatno name between its ownercould create new names very difficult (see Section 3.2).) What nameandshould be put into thename in itsRDATAarea exists. This implies a canonical orderingofall domain names inan RR with azone. The orderingname that isto sort labels as unsigned left justified octet strings wherewithin a wild card scope? Since theabsence of"next" existing name will be one that matches the wild card, the wild card name should be used. 5.5 Blocking NXT Pseudo-Zone Transfers In abyte sorts beforesecure zone, azero byte. Names are then sorted by sorting onresolver can query for the initial NXT associated with the zone name. Using the next domain name RDATA field from that RR, it can query for thehighest level label and then, within those names withnext NXT RR. By repeating this, it can walk through all thesame highest level label byNXTs in thenext lower label, etc. Since wezone. If there aretalking aboutno wildcards, it can use this technique to find all names in azone,zone. If it does type ANY queries, it can incrementally get all information in the zonename itself always existsandall other namesperhaps defeat attempts to administratively block zone transfers. If there are any wildcards, this NXT walking technique will not find Eastlake, Kaufman [Page 28] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 any more specific RR names in thezone name with some prefixpart oflower level labels. Thusthezonenameitself always sorts first. There is a slight problem withspace thelast NXD inwildcard covers. By doing explicit retrievals for wildcard names, azone as it wants to have an owner name which is the last existing name in sort order, which is easy,resolver could determine what intervals are covered by wildcards but still could not, with these techniques, find any names inside such intervals except by trying every name. If it isnot obvious what name to put in its RDATAdesired toindicate the entire remainder ofblock NXT walking, thename space. Thisrecommended method ishandled by treating the name space as circular and putting theto add a zonename in the RDATAwide wildcard of thelast NXD. There are additional complexities due to interactionKEY type withwildcards as explained below. The NXD RRs for a zone can be automatically calculatedthe no key bit on andaddedwith no type (zone, entity, or user) bit on. This will cause there toEastlake, Kaufman [Page 22] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 thebe one zoneby the same recommended off-line process that signscovering NXT RR and leak no information about what real names exist in the zone.The NXD RR's TTL should not exceedThis protection from pseudo-zone transfers is bought at thezone minimum TTL. The type number forexpense of eliminating theNXD RR is xxx. 5.2 NXD RDATA Format The RDATA for an NXD RR consists simplydata origin authentication ofa domain name. 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | next domain name / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5.3 Example Assume athe non-existence of names that NXT RRs can provide. If an entire zonehas entries for big.foo.bar, medium.foo.bar. small.foo.bar. tiny.foo.bar. Thenis covered by aquery towildcard, asecurity awaremalicious serverfor huge.foo.bar would producecan return anerror reply with the additional information section containing big.foo.bar. NXD medium.foo.bar. andRR produced by matching thecorresponding SIG RR. 5.4 Interaction of NXD RRs and Wildcard RRs As aresulting wildcardRR causes all possible names in an interval to exist, there should not be an NXD record that would cover any part of this interval. Thus if *.X.ZONE exists you would expect an NXD RR that ends at X.ZONENXT and can thus hide all the real data andone that startsdelegations with more specific names in thelast name covered by *.X.ZONE. However, this "lastzone. 5.6 Special Considerations at Delegation Points A namecovered"other than root which issomething very ugly and long like \255\255\255....X.zone. SotheNXD forhead of a zone also appears as theinterval following is simply givenleaf in a superzone. If both are secure, there will always be two different NXT RRs with theowner name *.X.zone. This "*" typesame name. They can be distinguished by their signers and next domain nameis not expandedfields. Security aware servers should return the correct NXT automatically when required to authenticate theNXD is returned as additional information in connection withnon-existence of a name and both NXTs, if available, on explicit query fora non-existent nametype NXT. Insecure servers will never automatically return an NXT and may only return the NXT from the subzone on explicit queries. Eastlake, Kaufman [Page23]29] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995type. If there could be any wildcard RRs in a zone6. The AD andthus wildcard NXDs, care must be taken in interpreting the results of explicit NXD retrievals asCD Bits and How to Resolve Securely Retrieving or resolving authentic data from theowner name may be a wildcard expansion. The existence ofDomain Name System (DNS) involves starting with one or morewildcard RRs covering a name interval makes it possible fortrusted public keys. With trusted keys, amalicious serverbrowser willing tohide any more specificly named RRs in the internal. The serverperform cryptography canjust falsely return the wildcard match NXD instead of the more specificly named RRs. If there is a zone wide wildcard, there will be only one NXD RR whose owner name and RDATA are bothprogress securely through the secure DNS zonename. In this case a server could concealstructure to theexistencezone ofany more specific RRsinterest as described inthe zone. (ItSection 6.3. Such trusted public keys would normally bepossible to make a more complex NXD feature, taking into account the types of RRs that did not existconfigured in aname interval, and the like, which would eliminate this possibility. But it would be more complex and would be so constraining asmanner similar tomake any future dynamic update featurethatcould create new names very difficult (seedescribed in Section3.2).) 5.5 Blocking NXD Pseudo-Zone Transfers In6.2. However, as asecure zone,practical matter, a security aware resolvercan query for the initial NXD associated with the zone name. Using the RDATA field from that RR, it can query for the next NXD RR. By repeating this, it can walk through all the NXDswould still gain some confidence in thezone. If there are no wildcards,results itcan use this technique to find all names in a zone. Ifreturns even if itdoes type ANY queries,was not configured with any keys but trusted what itcan incrementally get all information ingot from a local well known server as a starting point. Data stored at a server needs security labels of Authenticated, Pending, or Insecure. There is also a fourth transient state of Bad which indicates that SIG checks have explicitly failed on thezone and perhaps defeat attempts to administratively block zone transfers. If there are any wildcards, this NXD walking technique willdata. Such data is notfind any more specific RR names inretained at a security aware server. Authenticated means that thepartdata has a valid SIG under a KEY traceable via a chain ofthe name space the wildcard covers. By doing explicit retrievals for wildcard names,zero or more SIG and KEY RRs to a KEY configured at the resolvercould determine what intervals are covered by wildcards butvia its boot file. Pending data has no authenticated SIGs and at least one additional SIG the browser is stillcould not, with these techniques, find any names inside such intervals except bytryingevery name. Ifto authenticate. Insecure data is data which it isdesired to block NXD walking, the recommended methodknown can never be either authenticated or found bad because it isto addin a zonewide wildcard of the KEY typewiththeno keybit on and with no type (zone, entity,oruser) bit on. This will cause there to be only one NXD RRan experimental key. Behavior inthe zone for the zone nameterms of control of andleak no information about what real names exist in the zone. This protection from pseudo-zone transfersflagging based on such data labels isbought at the expensedescribed in Section 6.1. The proper validation ofeliminating the data origin authenticationsignatures requires a reasonably secure shared opinion of thenon-existenceabsolute time between resolvers and servers as described in Section 6.4. In getting to the data ofnames that NXD RRs can provide. If an entire zone is covered byinterest to respond to awildcard,query, amalicious server can return an RR produced by matching the resulting wildcard NXDsecure resolver may encounter genuine non-secure zones. It may proceed through such zones but should report this as described in Section 6.5. 6.1 The AD andcan thus hide allCD Header Bits Two unused bits are allocated out of the DNS query/response format header. The AD (authentic data) bit indicates in a response that therealdataand delegations with more specific namesincluded has been verified by the server providing it. The CD (checking disabled) bit indicates in a query that non-verified data is acceptable to thezone.resolver sending the query. These bits are allocated from the must-be-zero Z field as follows: Eastlake, Kaufman [Page24]30] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 19956. How1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ID | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |QR| Opcode |AA|TC|RD|RA| Z|AD|CD| RCODE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QDCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ANCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | NSCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ARCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ These bits are zero in old servers and resolvers. Thus the responses of old servers are not flagged as authenticated toResolve Securely Retrieving or resolving authentic datasecurity aware resolvers and queries from non-security aware resolvers do not assert theDNS involves startingchecking disabled bit and thus will be answered by security aware servers only withone or more trusted public keys and, in general, progressing securely from them throughauthenticated data. Of course security aware resolvers can not trust the AD bit unless they trust the server they are talking to and have a secure path to it. Any security aware resolver willing to do cryptography should assert the CD bit on all queries to reduce DNSzone structurelatency time by allowing security aware servers to answer before they have resolved thezonevalidity ofinterest. Such trusted public keys would normally be configureddata. Security aware servers never return bad data. For non-security aware resolvers or security aware resolvers requesting service by having the CD bit clear, security aware servers return only authenticated or insecure data with the AD bit set ina manner similarthe response. Security aware resolvers will know that if data is insecure versus authentic by the absence of SIG RRs. Security aware servers may return pending data tothat described in section 6.1. However, as a practical matter, asecurity awareresolver would still gain some confidenceresolvers requesting the service by clearing the AD bit in theresults it returns even if it was not configured with any keys but trusted what it got from a local well known server asresponse. The AD bit may only be set on astarting point. 6.1response if the RRs in the response are either authenticated or insecure. 6.2 Boot File Format Therecommendedformat for a boot filelinedirective to configure a startingkeyszone key is as follows: pubkey nameobjectflags protocol algorithm[exponent modulus]key-data for a public key."object" is the domain name of the thing the key is associated with and"name" is the owner nameif(if the line is translated into a KEY RR). Flags indicates the type of key and is Eastlake, Kaufman [Page 31] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 the same as the flagbyteoctet in the KEY RR. In particular, if the "no key" bit is on in flags, then all fields afterflagsalgorithm may be omitted. Algorithm is the algorithm in use where one is the MD5/RSA algorithm and 254 indicates a private algorithm. The material after the algorithm is algorithm dependent and, for private algorithms, starts with the algorithm's identifying OID.For the RSA algorithm, itIt isthe public key exponent as a decimal number between 3 and 16777215, and the modulusencoded in base 64 (see Appendix). A file of keys for cross certification or other purposes can be configured though the keyfile directive as follows: keyfile filename The file looks like a master file except that it can only contain KEY and SIG RRs with the SIGs signed under a key configured with the pubkey directive. While it might seem logical for everyone to start with the key for the root zone, this has problems. The logistics of updating every DNS resolver in the world when the root key changes would be excessive. It may be some time before there even is a root key. Furthermore, many organizations will explicitly wish their "interior" DNS implementations to completely trust only their own zone. These interior resolvers can then go through the organization's zone server to access data outsize the organization's domain.6.26.3 Chaining Through Zones Starting with one or more trustedzone key,keys for a zone, itisshould be possible to retrieve signed keys for its subzones which have akey.key and, if the zone is not root, for some superzone. Every authoritative secure zone(except root)server should also include the KEY RR foritsa super-zone signed by the secure zoneand with the owner name of the secure zone and object Eastlake, Kaufman [Page 25] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 name of the super-zone.via a keyfile directive. This makes it possible to climb the tree of zones if one starts below root. A secure sub-zone is indicated by a KEY RR appearing with the NS RRs for thesub-zone and with the same owner and object names.sub-zone. These make it possible to descend within the tree of zones. A resolver should keep track of the number of successive secure zones traversed from a starting point to any secure zone it can reach. In general, the lower such a distance number is, the greater the confidence in the data. Data configured via a boot file directive should be given a distance number of zero. Should a query encounter different data for the same query with different distance values, that with a larger value should be ignored. A security conscious resolver should completely refuse to step from a secure zone into a non-secure zone unless the non-secure zone is Eastlake, Kaufman [Page 32] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 certified to be non-secure or only experimentally secure by the presence of an authenticated KEY RR for the non-secure zone with a no key flag or the presence of a KEY RR with the experimental bit set. Otherwise the resolver is probably getting completely bogus or spoofed data. If legitimate non-secure zones are encountered in traversing the DNS tree, then no zone can be trustedas secure that can be reached only via information from such non-secure zones. Since the non-secure zone data could have been spoofed, the "secure" zone reach via it could be counterfeit. The "distance" to data in such zones or zones reached via such zones could be set to 512 or more as this exceeds the largest possible distance through secure zones in the DNS. Nevertheless, continuing to apply secure checks within "secure" zones reached via non-secure zones will, as a practical matter, provide some increase in security. The syntax of KEY RRs, with an arbitrary object name, provides for cross-certification. Although the syntax permits the owner name of a cross-certification KEY RR to be any name, by convention and to avoid an undue concentration of such KEY RRs under any particular name, their owner name should be the zone name prefixed with the destination object name (truncated an integral number of labels from the front if necessary due to DNS name restrictions). Thus a key for isoc.org would appear in the mit.edu zone with the owner name isoc.org.mit.edu and object name isoc.org. The existence of cross certifications adds further policy questions. Assume we have a zone B.A and a zone Y.X. Many possibilities exist for a secure resolver configured with the B.A key to get to Y.X. If all the zones along the way are secure, it could climb to root and then descend the other side, a total of four hops (B.A -> A -> . -> X -> Y.X). If the B.A administrator had installed a cross certified key for Y.X in the B.A zone, using that would be a shorter and Eastlake, Kaufman [Page 26] INTERNET-DRAFT DNS Protocol Security Extensions January 1995 presumably moreas secureway to find Y.X's key which wouldthat can beimmune toreached only via information from such non-secure zones. Since thenon-security or even compromise ofnon-secure zone data could have been spoofed, theservers for A or root"secure" zone reach via it could be counterfeit. The "distance" to data in such zones orX. But what if some less trusted subzone of B.A, say flakey.B.A installed a cross certified key for Y.X? If there is a conflict, should thiszones reached via such zones could bepreferredset toa hierarhically derived key obtained by climbing512 or more as this exceeds the largest possible distance through secure zones in the DNS. Nevertheless, continuing toroot and descending? Such questions are entirelyapply secure checks within "secure" zones reached via non-secure zones will, as amatter of local resolver policy. 6.3practical matter, provide some increase in security. 6.4 Secure Time Coordinated interpretation of the time fields in SIG RRs requires that reasonably consistent time be available to the hosts implementing the DNS security extensions. A variety of time synchronization protocols exist including the Network Time Protocol (NTP, RFC1305). If such protocols are used, they should be used securely so that time can not be spoofed. Otherwise, for example, a host could get its clock turned back and might then believe old SIG and KEY RRs which were valid but no longer are. Eastlake, Kaufman [Page27]33] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 7. Operational Considerations This section discusses a variety of considerations in secure operation ofDNSthe Domain Name System (DNS) using these proposed protocol extensions. 7.1 Key Size Considerations There are a number of factors that effect public key size choice for use in the DNS security extension. Unfortunately, these factors usually do not all point in the same direction. Choice ofazone key size should generally be made by the zone administrator depending on their local conditions. For most schemes, larger keys are more secure but slower.VerificationGiven a small public exponent, verification (the most common operation) for the MD5/RSA algorithm will vary roughly with the square of the modulus length, signing will vary with the cube of the modulus length, and key generation (the least common operation) will vary with the fourth power of the modulus length. The current best algorithms for factoring a modulus and breaking RSA security vary roughly with the square of the modulus itself. Thus going from a 640 bit modulus to a 1280 bit modulus only increases the verification time by a factor of 4 butvastlyincreases the work factor of breaking thekey.key by over 2^3000. [RSA FAQ] An upper bound of 2552 bit has been established for the MD4/RSA DNS security algorithm for interoperability purposes. However, larger keys increase size of the KEY and SIG RRs. This increases the chance of DNS UDP packet overflow and the possible necessity for using higher overheadTCP.TCP in responses. The recommended minimum RSA algorithm modulus size, 640 bits, is believed by the authors to be secure at this time and for some years but high level zones in the DNS tree may wish to set a higher minimum, perhaps 1000 bits, for security reasons. (Since the United States National Security Agency generally permits export of encryption systems using an RSA modulus of up to 512 bits, use of that small a modulus, i.e. n, must be considered weak.) For a key used only to secure data and not to secure other keys, 640 bits should be entirely adequate. Eastlake, Kaufman [Page 34] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 7.2 Key Storage It is strongly recommended that zone private keys and the zone file master copy be kept and used in off-line non-network connected physically secure machines only. Periodically an application can be run to re-sign the RRs in a zone by addingNXDNXT and SIG RRs. Then the augmented file can be transferred, perhaps by sneaker-net, to theEastlake, Kaufman [Page 28] INTERNET-DRAFT DNS Protocol Security Extensions January 1995networked zone primary server machine. The idea is to have a one way information flow to the network to avoid the possibility of tampering from the network. Keeping the zone master file on-line on the network and simply cycling it through an off-line signer does not do this. The on-line version could still be tampered with if the host it resides on is compromised.TheFor maximum security, the master copy of the zone file should be off net and should not be updated based on an unsecured network mediated communication. Note, however, that secure resolvers need to be configured with some trusted on-line public key information (or a secure path to such a resolver). Non-zone private keys, such as host or user keys, may have to be kept on line to be used for real-time purposes such aIP secureIPSEC session set-up or secure mail. 7.3 Key Generation Careful key generation is a sometimes over looked but absolutely essential element in any cryptographically secure system. The strongest algorithms used with the longest keys are still of no use if an adversary can guess enough to lower the size of the likely key space so that it can be exhaustively searched. Suggestions will be found indraft-ietf-security-randomness-*.txt.RFC 1750. It is strongly recommended that key generation also occur off-line, perhaps on the machine used to sign zones (see Section 7.2). 7.4 Key Lifetimes No key should be used forever. The longer a key is in use, the greater the probability that it will havebeen compromised through carelessness, accident, espionage, or cryptanalysis. Nobeen compromised through carelessness, accident, espionage, or cryptanalysis. Furthermore, if key rollover is a rare event, there is an increased risk that, when the time does come up change the key, no one at the site will remember how to do it or other problems will have developed in the Eastlake, Kaufman [Page 35] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 procedures. While key lifetime is a matter of local policy, these considerations suggest that no zone key should have a lifetime significantly overfivefour years.The recommendedA reasonable maximum lifetime for zone keys that are kept off-line and carefully guarded is 13 months with the intent that they be replaced every year.The recommendedA reasonable maximum lifetime for end entity keys that are used for IP-security or the like and are kept on line is 36 days with the intent that they be replaced monthly or more often. In some cases, an entity key lifetime ofa littlesomewhat over a day may be reasonable.Key lifetimes significantly over a year increase the risk that, when the time comes up change the key, no one at the site will remember how to do it. Eastlake, Kaufman [Page 29] INTERNET-DRAFT DNS Protocol Security Extensions January 19957.5 Signature Lifetime Signature expiration times must be set farenoughtenough in the future that it is quite certain that new signatures can be generated before the old ones expire. However, setting expiration too far into the future could, if bad data or signatures were ever generated, mean a long time to flush such badness. It is recommended that signature lifetime be a small multiple of the TTL but not less than a reasonable re-signing interval. 7.6 Root It should be noted that in DNS the root is a zone unto itself. Thus the root zone key should only beseeseen signing itself or signing RRs with names one level below root, such as .aq, .edu, or .arpa. Implementations MAY reject as bogus any purported root signature of records with a name more than one level below root. Eastlake, Kaufman [Page30]36] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 8. Conformance Several levels of server and resolver conformance are defined. 8.1 Server ConformanceThreeTwo levels of server conformance are defined as follows:BasicMinimal server compliance is the ability to store and retrieve (including zone transfer) SIG, KEY, andNXDNXT RRs.SecondariesAny secondary, caching, or other server for a secure zone must be at leastbasicly compliant. Mediumminimally compliant and even then some things, such as secure CNAMEs, will not work. Full server compliance adds the following to basic compliance: (1) ability to read SIG, KEY, andNXDNXT RRs in zone files and (2) ability, given a zone file and private key, to add appropriate SIG andNXDNXT RRs, possibly via a separateapplication. Primary servers for secure zones must be at least minimally compliant. Full server compliance is ability to automatically includeapplication, (3) proper automatic inclusion of SIG, KEY, andNXDNXT RRs inresponsesresponses, (4) suppression of CNAME following on retrieval of the security type RRs, (5) recognize the CD query header bit and set the AD query header bit, as appropriate, and (6) proper handling of the two NXT RRs at delegation points. Primary servers for secure zones MUST be fully compliant and for completely successful secure operation, all secondary, caching, and other servers handling the zone should be fully compliant aswell as meeting medium compliance.well. 8.2 Resolver Conformance Two levels of resolver compliance are defined: A basic compliance resolver can handle SIG, KEY, andNXDNXT RRs when they are explicitly requested. A fully compliant resolver (1) understands KEY, SIG, andNXDNXT RRs, (2) maintains appropriate information in its local caches and database to indicate which RRs have been authenticated and to what extent they have been authenticated,and(3) performs additional queries as necessary to attempt to obtain KEY, SIG, orNXDNXT RRs fromnon-securitynon- security awareservers.servers, (4) normally sets the CD query header bit on its queries. Eastlake, Kaufman [Page31]37] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 9. Security Considerations This document concerns technical details of extensions to the Domain Name System (DNS) protocol to provide data integrity and data origin authentication, public key distribution, and optional transaction security. If should be noted that, at most, these extensions guarantee the validity of resource records, including KEY resource records, retrieved from the DNS. They do not magically solve other security problems. For example, using secure DNS you can have high confidence in the IP address you retrieve for a host; however, this does not stop someone for substituting an unauthorized host at that address or capturing packets sent to that address and responding with packets apparently from that address. Any reasonably complete security system will require the protection of many other facets of the Internet. References [PKCS1] - PKCS #1: RSA Encryption Standard, RSA Data Security, Inc., 3 June 1991, Version 1.4. [RFC1032] - Domain Administrators Guide, M. Stahl, November 1987 [RFC1033] - Domain Administrators Operations Guide, M. Lottor, November 1987 [RFC1034] - Domain Names - Concepts and Facilities, P. Mockapetris, November 1987 [RFC1035] - Domain Names - Implementation and Specifications [RFC1305] - Network Time Protocol (v3), D. Mills, April 9 1992. [RFC1321] - The MD5 Message-Digest Algorithm, R. Rivest, April 16 1992. [RFC1750] - Randomness Requirements for Security, D. Eastlake, S. Crocker, J. Schiller, December 1994. [RSA FAQ] - RSADSI Frequently Asked Questions periodic posting. Eastlake, Kaufman [Page32]38] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 Authors Addresses Donald E. Eastlake, 3rdDigital Equipment Corporation 550 King Street, LKG2-1/BB3 Littleton,CyberCash, Inc. 318 Acton Street Carlisle, MA0146001741 USA Telephone: +1 508486 6577(w) +1 5082874877(h)4877 EMail:dee@lkg.dec.comdee@cybercash.com Charles W. Kaufman Iris Associates 1 Technology Park Drive Westford, MA 01886 USA Telephone: +1 508-392-5276 EMail: charlie_kaufman@iris.com Expiration and File Name This draft expires1 July24 December 1995. Its file name isdraft-ietf-dnssec-secext-03.txt.draft-ietf-dnssec-secext-04.txt. Eastlake, Kaufman [Page33]39] INTERNET-DRAFT DNS Protocol Security ExtensionsJanuary25 June 1995 Appendix: Base 64 Encoding The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here ina slightlyan edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded outputEastlake, Kaufman [Page 34] INTERNET-DRAFT DNS Protocol Security Extensions January 1995will be an integral multiple of 4 characters with no "=" padding, (2) Eastlake, Kaufman [Page 40] INTERNET-DRAFT DNS Protocol Security Extensions 25 June 1995 the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. Eastlake, Kaufman [Page35]41] ----