RFC 9044
Using the AES-GMAC Algorithm with the Cryptographic Message Syntax (CMS)
RFC 9044: Using the AES-GMAC Algorithm with the Cryptographic Message Syntax (CMS) π
okay bestie, this is RFC 9044 π¦ It's written by R. Housley from Vigil Security, and it's an Internet Standards Track document, so it's official and actually used. It was published in June 2021 and has the ISSN 2070-1721. It comes from the IETF (Internet Engineering Task Force), the crew that keeps the internet's protocols organized π The header has no "Obsoletes" or "Updates" line, so it doesn't replace or change any other RFC. Main character, no side quests πΈ
Abstract π
This doc explains how to use the AES-GMAC Message Authentication Code algorithm with the Cryptographic Message Syntax (CMS) from RFC 5652. It's all about the conventions, aka the rules of the road β¨
Status of This Memo π
This is an Internet Standards Track document π₯
It's a product of the IETF, and it reflects what the IETF community agreed on. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check Section 2 of RFC 7841. π«Ά
For the latest status, any errata, and how to give feedback, go to https://www.rfc-editor.org/info/rfc9044. π
Copyright Notice π
Copyright (c) 2021 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, which you can find at https://trustee.ietf.org/license-info, as they were in effect when this was published. Please actually read those, because they spell out your rights and restrictions for this document. Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes. β
Table of Contents π§
1. Introduction
2. Terminology
3. Message Authentication Code Algorithms
3.1. AES-GMAC
4. Implementation Considerations
5. ASN.1 Module
6. IANA Considerations
7. Security Considerations
8. References
8.1. Normative References
8.2. Informative References
Acknowledgements
Author's Address
1. Introduction β¨
Okay so this section is the setup π The doc explains how to use the AES-GMAC [AES] [GCM] Message Authentication Code (MAC) algorithm with the Cryptographic Message Syntax (CMS) [RFC5652]. Basically, it's the recipe for pairing those two. π¦
2. Terminology π
So here's the deal with the key words. The words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are BCP 14 [RFC2119] [RFC8174] key words. They mean what BCP 14 says, but only when they're in all capitals, exactly like this. π
3. Message Authentication Code Algorithms πΈ
This section covers the conventions that CMS [RFC5652] implementations follow when they support the AES-GMAC [AES] [GCM] Message Authentication Code (MAC) algorithm. π
The MAC algorithm identifiers live in the AuthenticatedData macAlgorithm field. π₯
The MAC values live in the AuthenticatedData mac field. π¦
3.1. AES-GMAC π
The AES-GMAC [AES] [GCM] Message Authentication Code (MAC) algorithm uses one of the following algorithm identifiers in the AuthenticatedData macAlgorithm field. Which one you use depends on the AES key size, which is 128 bits, 192 bits, or 256 bits: π
aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840)
organization(1) gov(101) csor(3) nistAlgorithm(4) 1 }
id-aes128-GMAC OBJECT IDENTIFIER ::= { aes 9 }
id-aes192-GMAC OBJECT IDENTIFIER ::= { aes 29 }
id-aes256-GMAC OBJECT IDENTIFIER ::= { aes 49 }
For all three of these identifier values, the AlgorithmIdentifier parameters field MUST be present, and the parameters MUST contain GMACParameters: β¨
GMACParameters ::= SEQUENCE {
nonce OCTET STRING, -- recommended size is 12 octets
length MACLength DEFAULT 12 }
MACLength ::= INTEGER (12 | 13 | 14 | 15 | 16)
The GMACParameters nonce field is the GMAC initialization vector. The nonce can have any number of bits from 8 up to (2^64)-1, but it MUST be a multiple of 8 bits. Within the scope of any content-authentication key, the nonce value MUST be unique. A 12-octet nonce gets processed more efficiently, so that length for the nonce value is RECOMMENDED. π«Ά
The GMACParameters length field tells you the size of the message authentication code. It MUST match the size in octets of the value in the AuthenticatedData mac field. A length of 12 octets is RECOMMENDED. π
4. Implementation Considerations π οΈ
An implementation of the Advanced Encryption Standard (AES) Galois/Counter Mode (GCM) authenticated encryption algorithm is specified in [GCM]. π¦
You can use an AES-GCM implementation to compute the GMAC message authentication code. You give it the content-authentication key as the AES key, the nonce as the initialization vector, a zero-length plaintext content, and the content you want authenticated as the additional authenticated data (AAD). The result of the AES-GCM invocation is the AES-GMAC authentication code, which some implementations call the "authentication tag". In AES-GCM, the encryption step gets skipped when no input plaintext is provided, so no ciphertext is produced. It's giving efficiency π
The DEFAULT and RECOMMENDED values in GMACParameters were picked to line up with the parameters defined for AES-GCM in Section 3.2 of [RFC5084]. πΈ
5. ASN.1 Module π§
The following ASN.1 module uses the definition for MAC-ALGORITHM from [RFC5912]. This is the formal version, so take a breath π
CryptographicMessageSyntaxGMACAlgorithms
{ iso(1) member-body(2) us(840) rsadsi(113549)
pkcs(1) pkcs-9(9) smime(16) modules(0)
id-mod-aes-gmac-alg-2020(72) }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- EXPORTS All
IMPORTS
AlgorithmIdentifier{}, MAC-ALGORITHM
FROM AlgorithmInformation-2009 -- from [RFC5912]
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-algorithmInformation-02(58)} ;
-- Object Identifiers
aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840)
organization(1) gov(101) csor(3) nistAlgorithm(4) 1 }
id-aes128-GMAC OBJECT IDENTIFIER ::= { aes 9 }
id-aes192-GMAC OBJECT IDENTIFIER ::= { aes 29 }
id-aes256-GMAC OBJECT IDENTIFIER ::= { aes 49 }
-- GMAC Parameters
GMACParameters ::= SEQUENCE {
nonce OCTET STRING, -- recommended size is 12 octets
length MACLength DEFAULT 12 }
MACLength ::= INTEGER (12 | 13 | 14 | 15 | 16)
-- Algorithm Identifiers
maca-aes128-GMAC MAC-ALGORITHM ::= {
IDENTIFIER id-aes128-GMAC
PARAMS TYPE GMACParameters ARE required
IS-KEYED-MAC TRUE }
maca-aes192-GMAC MAC-ALGORITHM ::= {
IDENTIFIER id-aes192-GMAC
PARAMS TYPE GMACParameters ARE required
IS-KEYED-MAC TRUE }
maca-aes256-GMAC MAC-ALGORITHM ::= {
IDENTIFIER id-aes256-GMAC
PARAMS TYPE GMACParameters ARE required
IS-KEYED-MAC TRUE }
END -- of CryptographicMessageSyntaxGMACAlgorithms
Next up in part 2: IANA Considerations, Security Considerations (the spicy part π₯), References, Acknowledgements, and the Author's Address π«Ά
8.1. Normative References
okay so these are the must-read-first docs, bestie πβ¨ the stuff this spec leans on to work at all
[AES]National Institute of Standards and Technology, "Advanced Encryption Standard (AES)", FIPS PUB 197, DOI 10.6028/NIST.FIPS.197, November 2001,https://doi.org/10.6028/NIST.FIPS.197. π[GCM]Dworkin, M., "Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC", NIST Special Publication 800-38D, DOI 10.6028/NIST.SP.800-38D, November 2007,https://doi.org/10.6028/NIST.SP.800-38D. π§[RFC2119]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,https://www.rfc-editor.org/info/rfc2119. π[RFC5652]Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10.17487/RFC5652, September 2009,https://www.rfc-editor.org/info/rfc5652. π¦[RFC5912]Hoffman, P. and J. Schaad, "New ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, DOI 10.17487/RFC5912, June 2010,https://www.rfc-editor.org/info/rfc5912. πΈ[RFC8174]Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,https://www.rfc-editor.org/info/rfc8174. π
8.2. Informative References
these ones are the extra reading π§ not required to build the thing, but SO worth a look if you want the backstory
[F2005]Ferguson, N., "Authentication weaknesses in GCM", May 2005,https://csrc.nist.gov/csrc/media/projects/block-cipher-techniques/documents/bcm/comments/cwc-gcm/ferguson2.pdf. π[MV2005]McGrew, D. and J. Viega, "GCM Update", May 2005,https://csrc.nist.gov/CSRC/media/Projects/Block-Cipher-Techniques/documents/BCM/Comments/CWC-GCM/gcm-update.pdf. β¨[RFC4086]Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, DOI 10.17487/RFC4086, June 2005,https://www.rfc-editor.org/info/rfc4086. π²[RFC5084]Housley, R., "Using AES-CCM and AES-GCM Authenticated Encryption in the Cryptographic Message Syntax (CMS)", RFC 5084, DOI 10.17487/RFC5084, November 2007,https://www.rfc-editor.org/info/rfc5084. π«Ά[RFC7696]Housley, R., "Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms", BCP 201, RFC 7696, DOI 10.17487/RFC7696, November 2015,https://www.rfc-editor.org/info/rfc7696. π
Acknowledgements β¨
huge thank-yous to Hans Aschauer, Hendrik Brockhaus, Quynh Dang, Roman Danyliw, Tim Hollebeek, Ben Kaduk, Mike Ounsworth, and Magnus Westerlund for their careful review and thoughtful improvements π₯Ήπ
Author's Address ποΈ
Russ Housley
Vigil Security, LLC
516 Dranesville Road
Herndon, VA 20170
United States of America
Email: housley@vigilsec.com
That's the whole thing, bestie! ππ
π¦ where this page comes from
- ietf: rfc9044 2021-06
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms