RFC 3274

Compressed Data Content Type for Cryptographic Message Syntax (CMS)

πŸ“… published June 2002, from ietf

Okay so this is RFC 3274, Compressed Data Content Type for Cryptographic Message Syntax (CMS) πŸŽ€ P. Gutmann from the University of Auckland wrote it, it's a Standards Track doc, and it's dated June 2002 πŸ’– The header doesn't say it obsoletes or updates anything, so there's nothing to flag there ✨

Status of This Memo ✨

Bestie, this is an Internet standards track protocol for the Internet community πŸ¦‹ The author wants discussion and suggestions for improvements 🫢 For where this protocol stands in standardization, check the current "Internet Official Protocol Standards" (STD 1) πŸ“š Distribution of this memo is unlimited 🌈

Copyright (C) The Internet Society (2002). All Rights Reserved. πŸ’œ

Abstract

Okay, the big idea: this doc defines a way to use compressed data as a Cryptographic Message Syntax (CMS) content type πŸ—œοΈ Compressing before transmission is giving multiple benefits. It gets rid of data redundancy that could help an attacker πŸ™ˆ, it speeds up later steps like signing or encryption because there's less data to process πŸ”₯, and the overall message size goes down πŸ¦‹

Compression at other layers has been proposed too, like at the MIME or SSL level. But those don't really fix compressing CMS content, unless the compression comes from an external source, like intermixing MIME and CMS πŸ’…

1. Introduction ✨

This doc describes a compressed data content type for CMS. It's a new ContentInfo type and an extension to the types already defined in CMS [RFC2630]. CMS implementations SHOULD include support for the CompressedData content type. πŸ’–

The format of the messages is described in ASN.1 [ASN1] πŸ“œ

The BCP 14 key words are the vibe check here: "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] πŸŽ€

1.1. Compressed Data Content Type

The compressed-data content type is content of any type, compressed with a specified algorithm πŸ—œοΈ This object identifier identifies it:

   id-ct-compressedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
     us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 9 }

The compressed-data content type shall have ASN.1 type CompressedData:

   CompressedData ::= SEQUENCE {
     version CMSVersion,
     compressionAlgorithm CompressionAlgorithmIdentifier,
     encapContentInfo EncapsulatedContentInfo
     }

Here's what the fields mean πŸ’…

  • version is the syntax version number. It MUST be 0. The details of the CMSVersion type are in CMS [RFC2630], section 10.2.5.
  • compressionAlgorithm is a compression algorithm identifier, as defined in section 2.
  • encapContentInfo is the content which is compressed. The details of the EncapsulatedContentInfo type are in CMS [RFC2630], section 5.2.

Implementations SHOULD use the SMIMECapabilities attribute to show they can process compressed content types 🫢 The details are in MSG [RFC2633], section 2.5.2.

A compression SMIMECapability is the AlgorithmIdentifier for the supported compression algorithm. For the algorithm in this document, that's id-alg-zlibCompression, as specified in section 2. Or, compression can be handled by prior arrangement, like as part of an interoperability profile 🌸

The SMIMECapability SEQUENCE for being able to process content compressed with the algorithm identified by id-alg-zlibCompression MUST be DER-encoded as this hexadecimal string πŸ”₯

   30 0D 06 0B 2A 86 48 86 F7 0D 01 09 10 03 08

(But also check out the implementation note in section 2.1 πŸ™ˆ)

2. Compression Types πŸ—œοΈ

CMS implementations that support the CompressedData content type MUST include support for the ZLIB compression algorithm [RFC1950] [RFC1951], which has a freely-available, portable and efficient reference implementation πŸ‘‘ This object identifier identifies ZLIB:

   id-alg-zlibCompress OBJECT IDENTIFIER ::= { iso(1) member-body(2)
     us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 8 }

This algorithm has no parameters. The parameters field SHOULD be encoded as omitted, but MAY be encoded as NULL (see the implementation note in section 2.1) πŸ¦‹

2.1. Implementation notes πŸ“

ZLIB has a bunch of compression levels, from good but slow compression to less good but fast compression ⚑ The compression level always works with the decompression algorithm, so you don't need to specify the compression level as an algorithm parameter. No drama πŸ’…

Okay, here's the messy history πŸ’€ There are two possible encodings for the ZLIB null parameters field. When the 1988 syntax for AlgorithmIdentifier got translated into the 1997 syntax, the OPTIONAL associated with the AlgorithmIdentifier parameters got lost. It was later recovered through a defect report, but by then everyone thought algorithm parameters were mandatory. So some implementations encode null parameters as an ASN.1 NULL element, and some omit them entirely (see for example section 12 of CMS [RFC2630]). The correct encoding is to omit the parameters field, but implementations may encounter encodings that use an ASN.1 NULL element for the parameters πŸ™ˆ

3. Security Considerations πŸ”

This RFC isn't concerned with security, except for one thing: compressing data before encryption can boost the security of other processing steps by reducing the amount of known plaintext available to an attacker πŸ”₯ However, implementations should be aware of possible security threats from combining security sensitive material with possibly untrusted data before compression and encryption. πŸ’€ Why? Because information about the sensitive data may be inferred from knowing the untrusted data and the compression ratio 😱

4. IANA Considerations πŸ“‹

The CompressedData content type and compression algorithms are identified by object identifiers (OIDs). The OIDs were assigned from an arc contributed to the S/MIME Working Group by RSA Security πŸŽ€ If more compression algorithms come along, their advocates are expected to assign the necessary OIDs from their own arcs. No action by the IANA is necessary for this document or any anticipated updates ✨

References πŸ“š

  • [ASN1] CCITT Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1), 1988.
  • [RFC2119] Bradner, S., "Key Words for Use in RFC's to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC1950] Deutsch, P. and J-L Gailly, "ZLIB Compressed Data Format Specification version 3.3", RFC 1950, May 1996.
  • [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification version 1.3", RFC 1951, May 1996.
  • [RFC2630] Housley, R., "Cryptographic Message Syntax", RFC 2630, June 1999.
  • [RFC2633] Rmasdell, B., "S/MIME Version 3 Message Specification", RFC 2633, June 1999.

Appendix A: ASN.1 Module 🧚

   CompressedDataContent
     { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
       smime(16) modules(0) compress(11) }

   DEFINITIONS IMPLICIT TAGS ::=
   BEGIN

   IMPORTS
     CMSVersion, EncapsulatedContentInfo FROM CryptographicMessageSyntax
       { iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) }
     AlgorithmIdentifier FROM AuthenticationFramework
       { joint-iso-itu-t ds(5) module(1) authenticationFramework(7) 3 };

   CompressedData ::= SEQUENCE {
     version CMSVersion,       -- Always set to 0
     compressionAlgorithm CompressionAlgorithmIdentifier,
     encapContentInfo EncapsulatedContentInfo
     }

   CompressionAlgorithmIdentifier ::= AlgorithmIdentifier

   -- Algorithm Identifiers

   id-alg-zlibCompress OBJECT IDENTIFIER ::= { iso(1) member-body(2)
       us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 8 }

   -- Content Type Object Identifiers

   id-ct-compressedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
       us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 9 }

   END

Author Address πŸ¦‹

  • Peter Gutmann
  • University of Auckland
  • Private Bag 92019
  • Auckland, New Zealand
  • EMail: pgut001@cs.auckland.ac.nz

Copyright (C) The Internet Society (2002). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR 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