RFC 2984

Use of the CAST-128 Encryption Algorithm in CMS

๐Ÿ“… published October 2000, from ietf

RFC 2984: Use of the CAST-128 Encryption Algorithm in CMS ๐ŸŽ€

okay bestie, this one is all about CAST-128 getting a seat at the table in S/MIME's CMS. It's a Standards Track doc from October 2000, written by C. Adams at Entrust Technologies ๐Ÿ’…. The header doesn't list any RFCs it obsoletes or updates, so it's just vibing on its own โœจ.


Status of this Memo ๐Ÿ“œ

This doc is an Internet standards track protocol for the Internet community, and it's basically asking for your thoughts and suggestions ๐Ÿ’ฌ. If you want to know where this protocol stands in the standardization process, check the current edition of "Internet Official Protocol Standards" (STD 1). Distribution is unlimited, so share away ๐Ÿฆ‹.

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐ŸŒธ

Abstract ๐Ÿ”ฎ

So this doc explains how to add CAST-128 (RFC2144) to the S/MIME Cryptographic Message Syntax (CMS) as an extra algorithm for symmetric encryption ๐Ÿ”. It gives you the OIDs and processing steps so CAST-128 can show up in the CMS spec (RFC2630) for both content and key encryption, no cap ๐Ÿ’œ.

The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document (in uppercase, as shown) are to be interpreted as described in [RFC2119] ๐ŸŽ€.

1. Motivation โœจ

Okay so S/MIME (Secure/Multipurpose Internet Mail Extensions) [SMIME2, SMIME3] is a set of specs for securely transporting MIME objects ๐Ÿ“ฌ. In the current S/MIME v3 specs, the mandatory-to-implement symmetric algorithm for content and key encryption is triple-DES (3DES) ๐Ÿ“. Honestly 3DES is totally fine in lots of cases, since it's generally considered to be high security. But in some environments it may be seen as too slow ๐Ÿข. To help with those performance worries, S/MIME has allowed any number of (optional) extra algorithms for symmetric content and key encryption ๐ŸŒˆ.

CAST-128 [RFC2144, Adams] is a well-studied symmetric cipher with some seriously appealing features, like pretty high performance and a variable key size (anywhere from 40 bits to 128 bits) ๐Ÿ”ฅ. It's royalty-free and license-free for commercial and non-commercial uses worldwide [IPR], so it's already all over the place in lots of Internet applications ๐ŸŒ. That makes it a suitable optional encryption algorithm for S/MIME, and honestly it's giving main character energy ๐Ÿ‘‘.

This document describes how to use CAST-128 within the S/MIME CMS specification ๐Ÿงš.

2. Specification ๐Ÿ’…

This section gives you the OIDs and processing info you need for CAST-128 to be used for content and key encryption in CMS ๐Ÿ’–.

2.1 OIDs for Content and Key Encryption ๐Ÿฆ‹

CAST-128 joins the set of optional symmetric encryption algorithms in CMS by getting two unique object identifiers (OIDs) ๐Ÿชช. One OID is for the content encryption algorithm and the other is for the key encryption algorithm. So a CMS agent can use CAST-128 for content or key encryption just by picking the right object identifier, supplying the required parameter, and starting the program code ๐Ÿ’œ.

For content encryption, using CAST-128 in cipher block chaining (CBC) mode is RECOMMENDED ๐ŸŒธ. The key length is variable, from 40 to 128 bits in 1-octet increments โœจ.

The CAST-128 content-encryption algorithm in CBC mode has this object identifier:

  cast5CBC OBJECT IDENTIFIER ::= {iso(1) member-body(2)
      us(840) nt(113533) nsn(7) algorithms(66) 10}

The parameter tied to this OID holds the initial vector IV and the key length:

  cast5CBCParameters ::= SEQUENCE {
      iv         OCTET STRING DEFAULT 0,
      -- Initialization vector
      keyLength  INTEGER
      -- Key length, in bits
  }

If you want the tea on how to handle the IV, check out [RFC2144] ๐Ÿซถ.

The key-wrap and unwrap procedures for encrypting and decrypting a CAST-128 content-encryption key with a CAST-128 key-encryption key are in Section 2.2 ๐Ÿ˜ค. How key-encryption keys get generated and distributed is out of scope for this doc ๐Ÿ™ˆ.

The CAST-128 key-encryption algorithm has this object identifier:

  cast5CMSkeywrap OBJECT IDENTIFIER ::= { iso(1)
      member-body(2) us(840) nt(113533) nsn(7)
      algorithms(66) 15}

This parameter only carries the key length, since the key wrapping procedure itself decides how and when to use an IV ๐ŸŽ€:

  cast5CMSkeywrapParameter ::= INTEGER
    -- key length, in bits

2.2 Key Wrapping and Unwrapping ๐Ÿ”

CAST-128 key wrapping and unwrapping follows CMS [RFC2630], period ๐Ÿ’….

2.2.1 CAST-128 Key Wrap ๐ŸŽ

Key wrapping with CAST-128 is identical to [RFC2630], Sections 12.6.1 and 12.6.4, with "RC2" swapped for "CAST-128" in the intro to 12.6.4 โœจ. Only 128-bit CAST-128 keys may be used as key-encryption keys, and they MUST be used with the cast5CMSkeywrapParameter set to 128 ๐Ÿ”ฅ. It is RECOMMENDED that the content-encryption key and the key-encryption key be the same size, since the security of the content will be at most the smaller of those two values ๐Ÿ’œ.

2.2.2 CAST-128 Key Unwrap ๐Ÿช„

Key unwrapping with CAST-128 is identical to [RFC2630], Sections 12.6.1 and 12.6.5, with "RC2" swapped for "CAST-128" in the intro to 12.6.5 ๐ŸŒˆ.

3. Using CAST-128 in S/MIME Clients ๐Ÿ“ฑ

An S/MIME client SHOULD announce the set of cryptographic functions it supports by using the S/MIME capabilities attribute ๐Ÿ“ฃ. This attribute gives a partial list of OIDs of cryptographic functions, and it MUST be signed by the client โœ๏ธ. The functions' OIDs SHOULD be logically separated into functional categories, and they MUST be ordered by preference ๐Ÿ—‚๏ธ.

If an S/MIME client is required to support symmetric encryption with CAST-128, the capabilities attribute MUST contain the cast5CBC OID from above in the category of symmetric algorithms ๐Ÿ”‘. The parameter tied to this OID (see above) MUST be used to indicate the supported key length ๐Ÿ“. For example, when the supported key length is 128 bits, the SMIMECapability SEQUENCE representing CAST-128 MUST be DER-encoded as this hexadecimal string:

    301106092A864886F67D07420A300402020080

When a sending agent creates an encrypted message, it has to decide which encryption algorithm to use ๐Ÿค”. The decision usually pulls from the capabilities lists in messages received from the recipient, plus other stuff like private agreements, user preferences, legal restrictions, and so on ๐Ÿ“‹. If users require CAST-128 for symmetric encryption, it MUST be supported by the S/MIME clients on both the sending and receiving side, and it MUST be set in the user preferences ๐Ÿ’–.

4. Security Considerations ๐Ÿ”๐Ÿ’€

This doc specifies using the CAST-128 symmetric cipher to encrypt the content of a CMS message and to encrypt the symmetric key used for that content ๐Ÿซฃ. CAST-128 allows variable-length keys, but you have to recognize that smaller key sizes (e.g., 40, 56, or 64 bits) may be unacceptably weak for some environments ๐Ÿ˜ฑ. Using larger key sizes (e.g., 128 bits) is always RECOMMENDED, when relevant import, export, or other laws permit ๐Ÿ›ก๏ธ. It is also RECOMMENDED that the content-encryption key and the key-encryption key be the same size, since the security of the content will be at most the smaller of those two values ๐Ÿ”’.

References ๐Ÿ“š

[Adams] C. Adams, "Constructing Symmetric Ciphers using the CAST Design Procedure", Designs, Codes, and Cryptography, vol.12, no.3, November 1997, pp.71-104.

[IPR] See the "IETF Page of Intellectual Property Rights Notices", http://www.ietf.cnri.reston.va.us/ipr.html

[RFC2144] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144, May 1997.

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2630] Housley, R., "Cryptographic Message Syntax", RFC 2630, June 1999.

[SMIME2] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L. and L. Repka, "S/MIME Version 2 Message Specification", RFC 2311, March 1998.

Dusse, S., Hoffman, P., Ramsdell, B. and J. Weinstein, "S/MIME Version 2 Certificate Handling", RFC 2312, March 1998.

[SMIME3] Ramsdell, B., "S/MIME Version 3 Certificate Handling", RFC 2632, June 1999.

Ramsdell, B., "S/MIME Version 3 Message Specification", RFC 2633, June 1999.

Author's Address ๐Ÿ–Š๏ธ

   Carlisle Adams
   Entrust Technologies
   1000 Innovation Drive,
   Kanata, Ontario, Canada K2K 3E7

   EMail: cadams@entrust.com

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐ŸŒท

This document, and translations of it, may be copied and handed out to others ๐Ÿ“„. Derivative works that comment on or explain it, or help with implementing it, may be prepared, copied, published, and distributed, in whole or in part, with no restrictions at all ๐ŸŽ‰, as long as the above copyright notice and this paragraph are on all those copies and derivative works ๐Ÿซถ. The document itself may not be modified in any way, such as by removing the copyright notice or the references to the Internet Society or other Internet organizations ๐Ÿšซ. The exception is when it's needed for developing Internet standards, in which case the copyright procedures in the Internet Standards process must be followed, or when it's being translated into languages other than English ๐ŸŒ.

The limited permissions above are perpetual and will not be revoked by the Internet Society or its successors or assigns โ™พ๏ธ.

This document and the information in it is provided "AS IS", and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED ๐Ÿ˜ฌ. That includes, but isn't limited to, any warranty that using the information here won't infringe any rights, and any implied warranties of merchantability or fitness for a particular purpose ๐Ÿ™…โ€โ™€๏ธ.

Acknowledgement ๐Ÿซถ

Funding for the RFC Editor function is currently provided by the Internet Society ๐Ÿ’œ.

๐Ÿ“ฆ where this page comes from