The CMS provides a method for authenticating data. This document identifies the conventions for using the AES-GMAC algorithm with the CMS.
The key management technique employed to distribute message-authentication keys must itself provide authentication; otherwise, the content is delivered with integrity from an unknown source.
When more than two parties share the same message-authentication key, data origin authentication is not provided. Any party that knows the message-authentication key can compute a valid MAC; therefore, the content could originate from any one of the parties.
Within the scope of any content-authentication key, the AES-GMAC nonce value
MUST be unique. Use of a nonce value more than once allows an attacker to generate valid AES-GMAC authentication codes for arbitrary messages, resulting in the loss of authentication as described in Appendix A of [
GCM].
Within the scope of any content-authentication key, the authentication tag length (MACLength)
MUST be fixed.
If AES-GMAC is used as a building block in another algorithm (e.g., as a pseudorandom function), AES-GMAC
MUST be used only one time by that algorithm. For instance, AES-GMAC
MUST NOT be used as the pseudorandom function for PBKDF2.
When initialization vector (IV) lengths other than 96 bits are used, the GHASH function is used to process the provided IV, which introduces a potential for IV collisions. However, IV collisions are not a concern with CMS AuthenticatedData because a fresh content-authentication key is usually generated for each message.
The probability of a successful forgery is close to 2^(-t), where t is the number of bits in the authentication tag length (MACLength*8). This nearly ideal authentication protection is achieved for CMS AuthenticatedData when a fresh content-authentication key is generated for each message. However, the strength of GMAC degrades slightly as a function of the length of the message being authenticated [
F2005] [
MV2005]. Implementations
SHOULD use 16-octet authentication tags for messages over 2^64 octets.
Implementations must randomly generate message-authentication keys. The use of inadequate pseudorandom number generators (PRNGs) to generate keys can result in little or no security. An attacker may find it much easier to reproduce the PRNG environment that produced the keys, searching the resulting small set of possibilities, rather than brute-force searching the whole key space. The generation of quality random numbers is difficult. [
RFC 4086] offers important guidance in this area.
Implementers should be aware that cryptographic algorithms become weaker with time. As new cryptanalysis techniques are developed and computing performance improves, the work factor to break a particular cryptographic algorithm will reduce. Therefore, cryptographic algorithm implementations should be modular, allowing new algorithms to be readily inserted. That is, implementers should be prepared to regularly update the set of algorithms in their implementations. More information is available in BCP 201 [
RFC 7696].