Compressed Data Content Type for Cryptographic Message Syntax (CMS)
Extracted elements (14)
Compressing data before encryption reduces known plaintext available to an attacker by eliminating data redundancy, thereby enhancing security provided by subsequent encryption steps.
Compression is defined at the CMS content layer rather than at MIME or SSL levels because those alternatives do not address compression of CMS content unless an external mechanism intermixes MIME and CMS.
ZLIB compression levels (ranging from good-but-slow to less-good-but-fast) need not be specified as algorithm parameters because any compression level is always compatible with the decompression algorithm.
Due to a historical ambiguity when translating the 1988 AlgorithmIdentifier syntax to 1997 syntax, some implementations encode ZLIB null parameters as an ASN.1 NULL element while others omit them entirely. Implementations must be prepared to accept both encodings.
CMS implementations SHOULD include support for the CompressedData content type.
CMS implementations that support the CompressedData content type MUST include support for the ZLIB compression algorithm (RFC 1950, RFC 1951).
Implementations SHOULD use the SMIMECapabilities attribute to indicate their ability to process compressed content types.
The SMIMECapability SEQUENCE representing the ability to process content compressed with id-alg-zlibCompression MUST be DER-encoded as the hexadecimal string: 30 0D 06 0B 2A 86 48 86 F7 0D 01 09 10 03 08.
The version field of CompressedData MUST be 0.
The ZLIB algorithm parameters field SHOULD be encoded as omitted, but MAY be encoded as NULL.
The compressed-data content type is identified by OID id-ct-compressedData: { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 9 }.
The ZLIB compression algorithm is identified by OID id-alg-zlibCompress: { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 8 }. This algorithm has no parameters.
Combining security-sensitive material with possibly untrusted data before compression and encryption can leak information about the sensitive data, because an attacker who knows the untrusted data can infer information from the compression ratio.
CompressedData is an ASN.1 SEQUENCE containing: version (CMSVersion, always 0), compressionAlgorithm (CompressionAlgorithmIdentifier), and encapContentInfo (EncapsulatedContentInfo) holding the compressed content.