Key wrapping and padding

All,

We have defined our "wrap" operation to be the concatenation of export and
encrypt. However, we have both:
- export formats that are arbitrary length (e.g. JWK, SPKI)
- encryption methods which accept only specific lengths (e.g. AES Key Wrap
which is RFC3394)

So we have a problem. I can see 3 solutions:

(a) disallow wrapping for these combinations of key format and encryption
algorithm (unwrap can still be supported - it's just the wrappers
responsibility to ensure the payload is an appropriate length)
(b) specify padding schemes on the key format side - i.e. specify how to
construct a JWK which is always a multiple of 8 bytes for AES-KW (this is
easy)
(c) specify padding schemes on the encryption algorithm side - i.e. specify
how to turn the restricted-length enc alg into a arbitrary length enc alg

Comments ? Preferences ?

...Mark

Received on Thursday, 19 December 2013 16:57:43 UTC