> Using draft-mcgrew-aead-aes-cbc-hmac-sha2 is not the same thing as (1).

Then change my vote to:

(1b) Use draft-mcgrew-aead-aes-cbc-hmac-sha2

I know draft-mcgrew-aead-aes-cbc-hmac-sha2 is not quite the same as 
A128CBC+HS256-without-a-KDF. There are a handful of 
“distinctions-without-a-difference” and some differences that are subtle but 
important where draft-mcgrew is better.

> It requires generating and adding specific padding bytes.

They both add identical padding. draft-mcgrew spells it out; A128CBC+HS256 just 
refers to PKCS #5 padding (without much of a reference).

> It prefixes the ciphertext with the IV.

Good design. But if JOSE insists on separate B64-encoded fields it is trivial 
to convert.

> It includes the length of the "additional authenticated data" in the MAC 
> calculation.

Great design. A128CBC+HS256, in contrast, relies on an extra B64-encoding step 
to safely distinguish “additional data” and “ciphertext”. A128CBC+HS256 has to 
MAC up to 33% more bytes than draft-mcgrew (when the plaintext size dominates).

While general-purpose crypto libraries only implement the AES & HMAC components 
but not the AEAD combination (and A128CBC+HS256 is only applied to small 
messages), it doesn’t matter much. However, once crypto libraries offer AEAD 
APIs it does. A128CBC+HS256 requires the “inside” of the crypto API to have the 
raw and B64 data but only one form will be passed across the API. That locks in 
duplicated effort and overhead so much so that I expect general purpose crypto 
libraries will support draft-mcgrew but not A128CBC+HS256.

> It combines the two outputs into one.

Again good design, but trivial to separate if desired.


Both JWA and draft-mcgrew refer to RFC 5116 “An Interface and Algorithms for 
Authenticated Encryption”. JOSE should follow the pattern specified in that 
RFC, which draft-mcgrew does.

--
James Manger

From: Michael Jones [mailto:[email protected]]
Sent: Monday, 12 November 2012 12:31 PM
To: Manger, James H; [email protected]
Subject: RE: [jose] Choice for WG: Use a KDF with AES CBC or use a longer key

Using draft-mcgrew-aead-aes-cbc-hmac-sha2 is not the same thing as (1).  For 
instance, as was discussed after David's presentation at IETF 84, 
draft-mcgrew-aead-aes-cbc-hmac-sha2 does not follow the pattern of AEAD 
algorithms such as AES GCM, which have two inputs (plaintext, "additional 
authenticated data"), and two outputs (ciphertext, "authentication tag").  
Instead, it adds a step combining the ciphertext and "authentication tag" 
outputs.

If you read the draft, implementation of draft-mcgrew-aead-aes-cbc-hmac-sha2 
has a lot more steps than what we have for A128CBC+HS256 and A256CBC+HS512.  It 
requires generating and adding specific padding bytes.  It prefixes the 
ciphertext with the IV.  It includes the length of the "additional 
authenticated data" in the MAC calculation.  It combines the two outputs into 
one.  For decryption, likewise, the two outputs must be split apart, the IV 
must be split apart, etc.

All of these are steps that implementations could get wrong, resulting in 
interoperability problems.  By keeping all the parameters separate, our current 
A128CBC+HS256 and A256CBC+HS512 algorithms eliminate those steps.

I'm sorry for the apparent confusion between (1) and 
draft-mcgrew-aead-aes-cbc-hmac-sha2.  While they both explicitly represent the 
CMK and CEK, and use the same underlying crypto operations, the details differ 
in ways that are likely to matter to implementers.  If there was a version of 
draft-mcgrew-aead-aes-cbc-hmac-sha2 that kept all the inputs and outputs 
separate, I agree that it would be a reasonable candidate for JOSE to consider. 
 But unlike AES GCM, that's not what it does.

-- Mike

> From: [email protected]<mailto:[email protected]>
> To: [email protected]<mailto:[email protected]>; 
> [email protected]<mailto:[email protected]>
> Date: Mon, 12 Nov 2012 09:23:37 +1100
> Subject: RE: [jose] Choice for WG: Use a KDF with AES CBC or use a longer key
>
> > So I’d like to explicitly ask the working group. Do you want us to:
> >
> > (1) Use the concatenation of random CEK and CIK values as the CMK for AES 
> > CBC, resulting in a longer CMK?
> > (2) Continue to use a KDF to generate the CEK and CIK from a shorter CMK?
>
>
> 1. Use draft-mcgrew-aead-aes-cbc-hmac-sha2
>
> --
> James Manger
_______________________________________________
jose mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/jose

Reply via email to