Subject: Re: [lamps] draft-housley-cms-mix-with-psk-03

From: Russ Housley <[email-masked]>
Date: Tue, 3 Apr 2018 15:07:29 -0400

I am working on -04.  These comments will be addressed.

Regarding Section 6, I suggest:

   Implementations must protect the pre-shared key (PSK), key transport
   private key, the agreement private key, the key-derivation key, and
   the key-encryption key.  Compromise of the PSK will make the
   encrypted content vulnerable to the future invention of a large-scale
   quantum computer.  Compromise of the PSK and either the key transport
   private key or the agreement private key may result in the disclosure
   of all contents protected with that combination of keying material.
   Compromise of the PSK and the key-derivation key may result in
   disclosure of all contents protected with that combination of keying
   material.  Compromise of the key-encryption key may result in the
   disclosure of all content-encryption keys or content-authenticated-
   encryption keys that were protected with that keying materail, which
   in turn may result in the disclosure of the content.

Russ

> On Mar 8, 2018, at 7:24 PM, Daniel Van Geest <[email-masked]> wrote:
> 
> Hi Russ,
> 
> I have a few minor nits and one (still minor) comment.
> 
> Section 2:
> 
> (nit) s/then all recipient obtain/then all recipients obtain/
> (nit) s/then key-derivation key is mixed/then the key-derivation key is mixed/ (x2)
> 
> Section 6:
> 
> “Compromise of the key transport private key or the agreement private key may result in the disclosure of all contents protected with that key. Compromise of the key-derivation key that is established with the key transport private key or the agreement private key may result in disclosure of the associated encrypted content.”
> 
> In this draft, disclosure of these keys would not result in the disclosure of the protected content unless the PSK was also disclosed.  I guess the “may” hedges those statements and makes them still technically true.  RFC 5652 says the same thing about the private keys, except in that case the disclosure of the keys would definitely allow disclosure of the protect content.  So maybe in this draft you want to qualify that if the private keys and the PSK are disclosed, the protected content may also be disclosed.
> 
> (nit) s/randomly generate key-derivation key/randomly generate key-derivation keys/
> (nit?) s/as well as the content-encryption key/as well as the content-encryption keys/
> (nit?) s/or content-authenticated-encryption key/or content-authenticated-encryption keys/
> (nit) s/If the key-encryption algorithm is different that/If the key-encryption algorithm is different than/
> (nit) s/Implementer should not/Implementers should not/
> (nit) s/send the same content in different in separate messages/send the same content in different/
> 
> Thanks,
> Dan
> 
> On 2018-03-05, 8:23 PM, "Spasm on behalf of Russ Housley" <[email-masked] on behalf of [email-masked]> wrote:
> 
>    I would like to make people on this mail list aware of this Internet-Draft.
> 
>    Russ
> 
>    = = = = = = = = = =
> 
>    A new version of I-D, draft-housley-cms-mix-with-psk-03.txt
>    has been successfully submitted by Russell Housley and posted to the
>    IETF repository.
> 
>    Name:		draft-housley-cms-mix-with-psk
>    Revision:	03
>    Title:		Using Pre-Shared Key (PSK) in the Cryptographic Message Syntax (CMS)
>    Document date:	2018-03-05
>    Group:		Individual Submission
>    Pages:		13
>    URL:            https://www.ietf.org/internet-drafts/draft-housley-cms-mix-with-psk-03.txt
>    Status:         https://datatracker.ietf.org/doc/draft-housley-cms-mix-with-psk/
>    Htmlized:       https://tools.ietf.org/html/draft-housley-cms-mix-with-psk-03
>    Htmlized:       https://datatracker.ietf.org/doc/html/draft-housley-cms-mix-with-psk-03
>    Diff:           https://www.ietf.org/rfcdiff?url2=draft-housley-cms-mix-with-psk-03
> 
>    Abstract:
>      The invention of a large-scale quantum computer would pose a serious
>      challenge for the cryptographic algorithms that are widely deployed
>      today.  The Cryptographic Message Syntax (CMS) supports key transport
>      and key agreement algorithms that could be broken by the invention of
>      such a quantum computer.  By storing communications that are
>      protected with the CMS today, someone could decrypt them in the
>      future when a large-scale quantum computer becomes available.  Once
>      quantum-secure key management algorithms are available, the CMS will
>      be extended to support them, if current syntax the does not
>      accommodated them.  In the near-term, this document describes a
>      mechanism to protect today's communication from the future invention
>      of a large-scale quantum computer by mixing the output of key
>      transport and key agreement algorithms with a pre-shared key.
> 
>    _______________________________________________
>    Spasm mailing list
>    [email-masked]
>    https://www.ietf.org/mailman/listinfo/spasm
> 
> 
> _______________________________________________
> Spasm mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/spasm

---

From: Russ Housley <[email-masked]>
Date: Tue, 3 Apr 2018 15:55:36 -0400

I am working on -04.  It will address these comments.

> I had some more thoughts on the draft, all from the Security Considerations section.
> 
> 1) "A large-scale quantum computer will effectively cut the security
>   provided by a symmetric key algorithm in half.  As a result, the PSK,
>   the key-derivation key, and the key-encryption key need at least 256
>   bits of entropy to provide 128 bits of security.  For this reason,
>   these symmetric keys SHOULD be at least 256 bits in length.”
> 
> Assuming the existence of a large-scale quantum computer which can break RSA/ECDH, the entropy of the key-derivation key is irrelevant since the key would be fully recoverable by a quantum computer. So, what’s really important is that the PSK contains 256 bits of entropy and the KDF is quantum resistant and outputs a key-encryption key with a length of at least 256 bits.

You are right.  I suggest:

   A large-scale quantum computer will essentially negate the security
   provided by the key transport algorithm or the key agreement
   algorithm, which means that the attacker with a large-scale quantum
   computer can discover the key-derivation key.  In addition a large-
   scale quantum computer effectively cuts the security provided by a
   symmetric key algorithm in half.  Therefore, the PSK needs at least
   256 bits of entropy to provide 128 bits of security.  To match that
   same level of security, the key derivation function needs to be
   quantum-resistant and produce a key-encryption key that is at least
   256 bits in length.  Similarly, the content-encryption key or
   content-authenticated-encryption key needs to be at least 256 bits in
   length.

> 2) This draft focuses on key transport and key agreement for the obvious reason that these are vulnerable to attack by a large-scale quantum computer, so maybe this suggestion is outside the scope of this draft.  For KEKRecipientInfo should you explicitly mention that this is already quantum resistant as long a quantum resistant key-encryption algorithm with key size of at least 256 bits is used?  Similarly that PasswordRecipientInfo is quantum-resistant as long as a quantum-resistant key-encryption algorithm with key size at least 256 bits is used and a quantum resistant KDF is used with a sufficiently large password (for some definition of sufficient). Or if no KDF is used, the key-encryption key from the external source has at least 256 bits of entropy.

Perhaps adding this to the end of the Introduction:

   Note that the CMS also supports key management techniques based on
   symmetric key-encryption keys and passwords, but they are not
   discussed in this document because they are already quantum
   resistant.  The symmetric key-encryption key technique is quantum
   resistant when used with an adequate key size.  The password
   technique is quantum resistant when used with a quantum-resistant key
   derivation function and a sufficiently large password.

> 3) This is hinted at in the introduction, but nowhere in the security considerations section do you state that the content-encryption key should be at least 256 bits long to be quantum resistant (as mentioned above, you do make this recommendation for the other keys in this draft).

This is addressed in the revised paragraph in 1).

> 4) "When using a key agreement algorithm, a key-encryption key is
>   produced to encrypt the content-encryption key or content-
>   authenticated-encryption key.”
> 
> In this draft, this is true not just for key agreement algorithms but for key transport algorithms as well.

I suggest:

   When using a PSK with a key transport or a key agreement algorithm, ...

> 5) "Implementers should not mix the quantum-resistant key management
>   algorithms with their non-quantum-resistant counterparts.  That is,
>   the same content should not be protected with KeyTransRecipientInfo
>   and KeyTransPSKRecipientInfo, and the same content should not be
>   protected with KeyAgreeRecipientInfo and KeyAgreePSKRecipientInfo.
>   Doing so would make the content vulnerable to the future invention of
>   a large-scale quantum computer.”
> 
> This is true not just for QR RecipientInfos with their non-QR counterparts, but for any QR RecipientInfo combined with any non-QR RecipientInfo, such as KeyTransPSKRecipientInfo with KeyAgreeRecipientInfo. So, I think this should be generalized to mixing QR and non-QR RecipientInfos.  I also wonder if this should be a SHOULD NOT rather than just a should not?

Yes, but I do not think we want to enumerate all four cases.  I suggest:

   Implementers SHOULD NOT mix quantum-resistant key management
   algorithms with their non-quantum-resistant counterparts.  For
   example, the same content should not be protected with
   KeyTransRecipientInfo and KeyTransPSKRecipientInfo.  Likewise, the
   same content should not be protected with KeyAgreeRecipientInfo and
   KeyAgreePSKRecipientInfo.  Doing so would make the content vulnerable
   to the future invention of a large-scale quantum computer.

> In the following paragraph talking about implementers sending the same content in different messages, I suppose you added this to prevent an implementer from getting around the previous paragraph by sending two messages without the user being aware?  This is fine, though I don’t think an implementer could/should practically prevent a user from being dumb and actively sending the same message twice.

In the CMS, EnvelopedData includes:

      RecipientInfos ::= SET SIZE (1..MAX) OF RecipientInfo

The first paragraph is saying do not mix QR and non-QR in this set.

The second paragraph is saying that you get the same consequence if separate messages are used to do the mixing.

Russ