RFC 7210
Database of Long-Lived Symmetric Cryptographic Keys
Database of Long-Lived Symmetric Cryptographic Keys ๐
Okay bestie, this is RFC 7210 and it's giving serious infrastructure main-character energy ๐ โจ. Here's the title block tea โ:
- RFC number: 7210
- Title: Database of Long-Lived Symmetric Cryptographic Keys
- Authors: R. Housley (Vigil Security), T. Polk (NIST), S. Hartman (Painless Security), and D. Zhang (Huawei Technologies Co. Ltd.)
- Category: Standards Track
- ISSN: 2070-1721
- Date: April 2014
- Obsoletes/Updates: the title block doesn't list anything this one obsoletes or updates ๐ฆ
Abstract ๐ธ
Okay so this doc lays out the info that goes into a conceptual database of long-lived cryptographic keys, the kind that tons of different routing protocols use to keep their messages secure ๐. The database is built to support both manual and automated key management, which is so iconic. ๐ Beyond describing the schema (the blueprint for what goes in the database), it also covers the operations you can do on the database and the requirements for routing protocols that want to use it. Here's the lowkey plot twist ๐ญ: in a lot of typical setups, the protocols don't actually use the long-lived key directly. Instead, a key derivation function takes that long-lived key and derives a short-lived key from it. Iykyk ๐ง
Status of This Memo โจ
This is an Internet Standards Track document. ๐
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, and it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 5741 ๐ซถ.
For the current status of this document, any errata, and how to give feedback on it, head to http://www.rfc-editor.org/info/rfc7210 ๐.
Copyright Notice ๐
Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date this document was published. Please actually read these, bestie, because they spell out your rights and restrictions with respect to this document ๐. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Simplified BSD License.
1. Introduction โจ
Okay, so this document spells out the info that needs to be included in a database of long-lived cryptographic keys in order to key the cryptographic authentication of routing protocols ๐. This conceptual database is designed to separate protocol-specific stuff from both manual and automated key management, which is so clean ๐ . The goal is to let lots of different implementation approaches to this key database exist while keeping specification simple and deployments heterogeneous (mixed, basically) ๐. It also avoids the need to build knowledge of any security protocol into key management protocols, and it minimizes protocol-specific knowledge in operational and management interfaces, and it constrains where that knowledge can even show up. Iconic restraint, honestly ๐.
Textual conventions are provided for representing keys and other identifiers. These conventions should be used when presenting keys and identifiers to operational or management interfaces, or when reading keys and identifiers from those interfaces. This is the vibe that satisfies the operational requirement that all implementations represent keys and key identifiers in the same way, so cross-vendor configuration instructions can be provided ๐งโจ.
Routing protocols can use the services of more generic security protocols such as TCP-AO [RFC5925] ๐ฆ. Implementations of routing protocols may need to supply keys to databases specific to these security protocols as the related entries in this document's conceptual database get manipulated ๐.
Here's the plot twist again ๐ญ: in many cases, the long-lived keys aren't used directly in security protocols. Instead, a key derivation function derives short-lived keys from the long-lived key in the database. In other cases, security protocols will directly use the long-lived key from the database. The database design supports both use cases, and I'm obsessed ๐ฅ.
1.1. Requirements Notation ๐
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] ๐ .
2. Conceptual Database Structure โจ
okay so the database is basically a table, and every row is one long-lived symmetric cryptographic key ๐ Normally each key gets exactly one row, bestie. The only times a key shows up in multiple rows are the (hopefully) super rare cases where it's used for more than one purpose, or where the same key is paired with multiple key derivation functions (KDFs) ๐ซถ The columns hold the key value and all of its attributes.
Since humans are gonna be managing these by hand, the fields are formatted so you can edit them in a plain-text editor and they look the same on multiple systems. Very considerate of the spec, honestly ๐
Here are the columns, in order:
AdminKeyName The AdminKeyName field is a human-readable string that helps the user identify the key ๐ Implementations can use it to uniquely identify rows in the key table. The same string can be used on the local system and on peer systems, but that's not required. Routing protocols don't use this string at all. They use LocalKeyName and PeerKeyName instead. BUT if these strings are going to be used as protocol elements in other protocols, or passed around between systems, they'll need to follow the requirements of Section 5.1 โจ
LocalKeyName The LocalKeyName field is a string that identifies the key ๐๏ธ It's what you use to look up the key in the local database when it shows up in a message. As Section 4 explains, the protocol decides what form this field takes. For example, lots of routing protocols only allow key names that are integers which fit in 16 or 32 bits. This field usually doesn't hold data in human character sets that need internationalization. If a routing protocol ever does need internationalized key names, its spec will have to deal with canonicalization and normalization, so the names can be compared using binary comparison ๐ค
PeerKeyName PeerKeyName is the name of the key that the local system uses in an outgoing message ๐ค For unicast communication, the PeerKeyName of a key on one system matches the LocalKeyName of the identical key maintained on one or more peer systems. Same as LocalKeyName, the protocol defines the form of this identifier and will often restrict it to an integer ๐ For group keys, the protocol will typically require this field to be an empty string, because the sending and receiving key names need to be the same ๐
Peers For unicast keys, this field usually lists the peer systems that have this key in their database ๐ง For group keys, it names the groups the key is appropriate for. For example, it might name a routing area for a multicast routing protocol. Basically this field sets a protocol-specific scope on where the key is allowed to be used. The protocol specifies the format of the identifiers in Peers ๐
Interfaces The Interfaces field identifies the set of physical and/or virtual interfaces where it's appropriate to use this key ๐ฆ When the long-lived value in the Key field is meant to be used on any interface, this field is set to "all". The field is a set of strings, and the implementation decides what those strings look like, totally independent of the protocol ๐ Protocols might require support for Interfaces, or they might say that constraining keys by interface isn't required. Example time: TCP-AO implementations are unlikely to pick the interface before they pick the key. So in that case they're expected to use the same keying material across all interfaces and then require the "all" setting ๐ญ
Protocol The Protocol field names a single routing protocol that this key may be used with to provide cryptographic protection ๐ก๏ธ This specification sets up a registry for this field. The registry also specifies the format of the next field, ProtocolSpecificInfo, for each registered protocol ๐
ProtocolSpecificInfo This field holds protocol-specified information that can help a protocol apply the key correctly โจ Important bit: such information MUST NOT be required for a protocol to locate an appropriate key. If a protocol doesn't need the information in ProtocolSpecificInfo, it will require this field to be empty. Key table rows MAY specify a Direction of "both". Because of that, the encoding of this field has to support encoding protocol-specific information for sending and receiving in the same row ๐
KDF The KDF field says which key derivation function is used to generate short-lived keys from the long-lived value in the Key field ๐ฅ When the long-lived value is meant for direct use, KDF is set to "none". A key derivation function is a one-way function that gives you cryptographic separation of key material ๐ง The KDF MAY use inputs from the row in the key table and from the message being sent or received, but it MUST NOT depend on other configuration state. This document sets up an IANA registry for the values in the KDF field, so future specs can reference them easily ๐ The protocol decides which KDFs (if any) are valid.
AlgID The AlgID field says which cryptographic algorithm gets used with the security protocol for the specified peer or peers ๐ It can be an encryption algorithm and mode (for example, AES-128-CBC), an authentication algorithm (for example, HMAC-SHA1-96 or AES-128-CMAC), or any other symmetric cryptographic algorithm a security protocol needs ๐ If KDF contains "none", the long-lived key gets used directly with this algorithm. Otherwise, the derived short-lived key is what gets used ๐ซง When the long-lived key is used to generate a set of short-lived keys, AlgID identifies a ciphersuite rather than a single algorithm. This document also sets up an IANA registry for the values in AlgID so future specs can reference them ๐ Protocols decide which algorithms are appropriate.
Key The Key field holds the long-lived symmetric cryptographic key as a lowercase hexadecimal string ๐๏ธ How big the key has to be depends on the KDF and the AlgID. For instance, KDF=none and AlgID=AES128 need a 128-bit key, which is written as 32 hexadecimal digits ๐งฎ
Direction The Direction field says whether this key can be used for inbound traffic, outbound traffic, both, or whether the key has been disabled and can't be used at all right now ๐ซ The supported values are "in", "out", "both", and "disabled", respectively. The Protocol field decides which of these values are valid ๐ฆ
SendLifetimeStart The SendLifetimeStart field specifies the earliest date and time, in Coordinated Universal Time (UTC), at which this key should be considered for use when sending traffic โฐ The format is YYYYMMDDHHSSZ: four digits for the year, two for the month, two for the day, two for the hour, two for the minute, and two for the second. The "Z" is included as a clear sign that the time is in UTC ๐
SendLifeTimeEnd The SendLifeTimeEnd field specifies the latest date and time at which this key should be considered for use when sending traffic ๐ The format is the same as SendLifetimeStart.
AcceptLifeTimeStart The AcceptLifeTimeStart field specifies the earliest date and time, in Coordinated Universal Time (UTC), at which this key should be considered for use when processing received traffic ๐ฅ The format is YYYYMMDDHHSSZ, where four digits specify the year, two digits specify the month, two digits specify the day, two digits specify the hour, two digits specify the minute, and two digits specify the second. The "Z" is included as a clear indication that the time is in UTC ๐ซ
AcceptLifeTimeEnd The AcceptLifeTimeEnd field specifies the latest date and time at which this key should be considered for use when processing received traffic ๐ฅน Its format is identical to AcceptLifeTimeStart.
3. Key Selection and Rollover โจ
okay so a protocol can literally peek at the key table to grab the key for an outgoing message ๐ ๐. It hands the key selection function a protocol (P) and a peer identifier (H), and sometimes an interface identifier (I) too if it needs one. A key is fair game if it passes all of these checks:
- the Peers field includes H;
- the Protocol field matches P;
- if the protocol specifies an interface, the Interfaces field in the key table row includes I or "all";
- the Direction field is either "out" or "both"; and
- SendLifetimeStart <= current time <= SendLifeTimeEnd.
Multiple entries can be alive at the same time, each tied to a different cryptographic algorithm or ciphersuite ๐ง. So systems should support picking keys by algorithm preference, which makes it way easier to switch algorithms later ๐.
Also, when entries have overlapping valid periods, they're meant to be ready for an orderly key rollover ๐ฆ. The idea is that systems move over to the newest key available. To make that happen, this specification recommends adding one more rule on top of the selection algorithm: pick the long-lived key with the most recent time in the SendLifetimeStart field ๐ .
When a protocol wants to check an incoming message, it gives over its protocol (P), the peer identifier (H), the key identifier (L), and optionally the interface (I) ๐ฅ. A single key that matches all of these conditions gets selected:
- the Peer field includes H;
- the Protocol field matches P;
- if the Interface field is provided, it includes I or is "all";
- the Direction field is either "in" or "both";
- the LocalKeyName is L; and
- AcceptLifeTimeStart <= current time <= AcceptLifeTimeEnd.
Heads up: the AcceptLifeTime times are only a loose boundary on key usage ๐ซถ. New security associations should not be established outside the period of use in these fields, though some grace time for clock skew is allowed โฐ. If a security association is already up using a long-lived key, going past the lifetime doesn't directly break anything ๐. Implementations of security protocols with long-lived associations should be designed to periodically check the database and roll over to new keys without tearing down the security associations ๐.
Instead of checking the conceptual database every time, a security protocol like TCP-AO might just update its own tables as keys get added or removed ๐ง. In that case, the protocol has to keep its own key information. Some routing protocols use IP Security (IPsec) for integrity ๐ก๏ธ. If a specification explains how to use the conceptual database in this document to set up keys for those routing protocols, the same concerns apply. That specification also needs to describe how the Security Policy Database is changed as rows are added and removed from the conceptual database ๐.
4. Application of the Database in a Security Protocol โจ
okay so if a protocol wants to use the key table database, its spec has to cover certain things ๐. This section lists what a protocol must specify ๐.
- The ways of mapping the information in a key table row to the information needed to produce an outgoing message. This is either an explanation of how to fill in authentication-related fields in a message based on key table information, or (for protocols such as TCP-AO) how to build Master Key Tuples (MKTs) or other protocol-specific structures from a key table row.
- The ways of finding the peer identifier (a member of the Peers set) and the LocalKeyName inside an incoming message ๐.
- The methods for verifying a message given a key table row. This can be stated directly or in terms of protocol-specific structures such as MKTs ๐.
- The form and validation rules for LocalKeyName and PeerKeyName. If either of these is an integer, the conventions in Section 5.1 are used as a vendor-independent format ๐ข.
- The form and validation rules for members of the Peers set ๐ฏ.
- The algorithms and KDFs supported ๐งช.
- The form of the ProtocolSpecificInfo field ๐ฆ.
- The rules for canonicalizing LocalKeyName, PeerKeyName, entries in the Peers set, or ProtocolSpecificInfo. This may include normalizations such as lowercasing hexadecimal strings ๐ค.
- The indication of whether support for Interfaces is required by this protocol ๐.
The form of the interfaces field isn't protocol specific. It's shared across all protocols on an implementation ๐ค. If a protocol needs to tell apart instances running over the same interface, that goes in the specification of peers ๐ . Generally, it's ideal to define the peers specification so an operator can use the Interfaces field to refer to all instances of a protocol on a link. That way they don't have to specify both generic interfaces information and protocol-specific peer information ๐.
5. Textual Conventions ๐
5.1. Key Names
When a key for a given protocol is identified by an integer key identifier, the key name is written as lowercase hexadecimal digits, most significant octet first ๐ข. The integer is padded with leading zero digits until it reaches the width of the key identifier field in the protocol ๐. If a key name has non-integer human-readable text, its format and encoding can get messy, especially when it's used in protocols between two different types of systems ๐ฌ. If ASCII range characters [RFC20] are enough for a key name, then they SHOULD be used ๐ธ. If characters outside that range are wanted or needed, then they MUST be in an encoding of Unicode [UNICODE] ๐.
For an AdminKeyName with characters outside the ASCII range, the AdminKeyName MUST be encoded using UTF-8 [RFC3629] and SHOULD be normalized using Unicode Normalization Form KC [UAX15]. This gives strings the best chance of comparing correctly ๐.
Still, Unicode Normalization Form KC alone doesn't solve every string comparison issue ๐. Check [PRECIS-FRAMEWORK] for more info ๐.
5.2. Keys
A key is written as a lowercase hexadecimal string, with its most significant octet first ๐ง. As discussed in Section 2, how long this string is depends on the associated algorithm and KDF ๐.
6. Operational Considerations ๐ท
If the valid periods for long-lived keys don't overlap, or the system clocks are out of sync, some scenarios can happen where systems just can't agree on a long-lived key ๐ญ. When installing a series of keys to be used one after another, operators should set the SendLifetimeStart field of the key to several hours after the AcceptLifeTimeStart field of the key. That way there's guaranteed overlap โณ. The overlap is there to handle clock skew and cover basic operational stuff ๐ซง. Operators may choose a longer overlap (for example, several days) for exceptional circumstances ๐๏ธ.
7. Security Considerations ๐
Managing encryption and authentication keys has been a huge operational headache, both for key synchronization and key selection ๐ฉ. For example, the current guidance [RFC3562] warns against sharing TCP MD5 keying material between systems and recommends changing keys on a schedule ๐. The same general operational issues come up for managing other cryptographic keys too ๐ฅบ.
[RFC4107] points out that automated key management isn't viable in multiple scenarios ๐ซ. The conceptual database in this document is built to handle both manual and automated key management ๐ค. A future specification to automatically fill rows in the database is envisioned โจ.
Designers should keep in mind the warning from [RFC4107] ๐:
Automated key management and manual key management provide very different features. In particular, the protocol associated with an automated key management technique will confirm the liveness of the peer, protect against replay, authenticate the source of the short-term session key, associate protocol state information with the short-term session key, and ensure that a fresh short-term session key is generated. Further, an automated key management protocol can improve interoperability by including negotiation mechanisms for cryptographic algorithms. These valuable features are impossible or extremely cumbersome to accomplish with manual key management.
8. IANA Considerations ๐
This specification defines three registries ๐๏ธ.
8.1. KeyTable Protocols
Per this document, IANA has set up a registry called "KeyTable Protocols" ๐.
All assignments to the KeyTable Protocols registry are made on a Specification Required basis per Section 4.1 of [RFC5226] ๐.
Each registration entry must contain these three fields:
- Protocol Name (unique within the registry);
- Protocol-Specific Info; and
- Reference.
The specification needs to describe the parameters required for using the conceptual database as outlined in Section 4. Typically, that means the specification focuses on applying security protocols with the key tables, rather than being a brand new general-purpose security protocol ๐ . Of course, new protocols can combine info on how to use the key table database with the protocol spec too ๐ซถ.
The registry has three columns ๐งพ. The first column is a string of Unicode characters encoded in UTF-8, showing the name of the protocol. The second column is a string of Unicode characters encoded in UTF-8, giving a brief description of Protocol-Specific Info. The third column is a reference to a specification that defines how the protocol is used with the key table ๐.
There are no initial registrations ๐ซฅ.
8.2. KeyTable KDFs
Per this document, IANA has set up a registry called "KeyTable KDFs". The rest of this section describes the registry ๐.
All assignments to the KeyTable KDFs registry are made on a First Come First Served basis per Section 4.1 of RFC 5226 ๐โโ๏ธ.
The registry has three columns ๐. The first column is a string of Unicode characters encoded in UTF-8, showing the name of a KDF. The second column is a string of Unicode characters encoded in UTF-8, giving a brief description of the KDF. The third column is a reference to a specification that defines the KDF, if one is available ๐.
The initial contents of this registry and the one in Section 8.3 are based on the algorithms defined for TCP-AO [RFC5926] ๐ง.
KDF Description Reference
------------ ---------------------------- ---------
none No KDF is used with this key N/A
AES-128-CMAC AES-CMAC using 128-bit keys [RFC4493]
HMAC-SHA-1 HMAC using the SHA-1 hash [RFC2104]
8.3. KeyTable AlgIDs ๐
Okay so, per this document, IANA set up a registry called "KeyTable AlgIDs" ๐ Everything below describes that registry, so let's dive in โจ
Assignments to the KeyTable AlgIDs registry are made on a First Come First Served basis per Section 4.1 of RFC 5226. Basically first come, first served ๐
The registry has three columns ๐ The first is the algorithm identifier (AlgID), a string of Unicode characters encoded in UTF-8. The second is a brief description of the algorithm, also Unicode in UTF-8. The third is a reference to the specification that defines the algorithm ๐ฆ
The starting contents of this registry, and the ones in Section 8.2, were picked based on the algorithms defined for TCP-AO [RFC5926]. Very on-brand for TCP-AO, honestly ๐ซถ
AlgID Description Reference
------------ --------------------------------- ---------
AES-128-CMAC AES-CMAC using 128-bit keys [RFC4493]
AES-128-CMAC-96 AES-128-CMAC truncated to 96 bits [RFC5926]
HMAC-SHA-1-96 HMAC SHA-1 truncated to 96 bits [RFC2104]
9. Acknowledgments ๐
This document reflects many discussions with many different people over many years ๐ธ The authors want to thank Jari Arkko, Ran Atkinson, Ron Bonica, Ross Callon, Lars Eggert, Pasi Eronen, Adrian Farrel, Gregory Lebovitz, Acee Lindem, Sandy Murphy, Eric Rescorla, Mike Shand, Dave Ward, and Brian Weis for their insights ๐ง They also thank Brian Weis for writing text to address IANA concerns and for helping with formatting ๐
Sam Hartman's work on this document is funded by Huawei ๐
10. Normative References ๐
[RFC20] Cerf, V., "ASCII format for network interchange", RFC 20,
October 1969.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[UAX15] The Unicode Consortium, "Unicode Standard Annex #15:
Unicode Normalization Forms", Unicode 6.3.0, September
2013, <http://www.unicode.org/reports/tr15/tr15-39.html>.
[UNICODE] The Unicode Consortium, "The Unicode Standard, Version
6.3.0", (Mountain View, CA: The Unicode Consortium, 2013.
ISBN 978-1-936213-08-5),
<http://www.unicode.org/versions/Unicode6.3.0/>.
11. Informative References ๐
[PRECIS-FRAMEWORK]
Saint-Andre, P. and M. Blanchet, "PRECIS Framework:
Preparation and Comparison of Internationalized Strings in
Application Protocols", Work in Progress, March 2014.
[RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", RFC 2104, February
1997.
[RFC3562] Leech, M., "Key Management Considerations for the TCP MD5
Signature Option", RFC 3562, July 2003.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, November 2003.
[RFC4107] Bellovin, S. and R. Housley, "Guidelines for Cryptographic
Key Management", BCP 107, RFC 4107, June 2005.
[RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The
AES-CMAC Algorithm", RFC 4493, June 2006.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008.
[RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP
Authentication Option", RFC 5925, June 2010.
[RFC5926] Lebovitz, G. and E. Rescorla, "Cryptographic Algorithms
for the TCP Authentication Option (TCP-AO)", RFC 5926,
June 2010.
Authors' Addresses ๐
Russell Housley
Vigil Security, LLC
918 Spring Knoll Drive
Herndon, VA 20170
USA
EMail: housley@vigilsec.com
Tim Polk
National Institute of Standards and Technology
100 Bureau Drive, Mail Stop 8930
Gaithersburg, MD 20899-8930
USA
EMail: tim.polk@nist.gov
Sam Hartman
Painless Security, LLC
USA
EMail: hartmans-ietf@mit.edu
Dacheng Zhang
Huawei Technologies Co. Ltd.
China
EMail: zhangdacheng@huawei.com
๐ฆ where this page comes from
- ietf: rfc7210 2014-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms