I am new to cryptography and have a question. If I try to wrap some key using an AES key using DES3_CBC_PAD as a wrapping mechanism will this go to work? I am doing this operation inside an HSM.

  • $\begingroup$ There will be differences since the different block sizes. There is a Key Wrapping for AES. See rfc3394 $\endgroup$ – kelalaka Jan 14 at 17:50

No, likely this won't work. Almost all HSM's will only accept wrapping keys of a type that is compatible with the encryption / wrapping algorithm. Commonly it is impossible to get to the value of the key as well, so that won't save you.

Sometimes you can wrap a key to export it and then re-import it again. Then you might be able to create a new AES key from the remnants of the exported key. You would of course then use AES-192 or AES-128 if you use only the first 16 bytes of the ciphertext. Generally this won't work for FIPS mode though, so applicability might be limited. And you'd of course loose 16 bits or more of key space because of the parity bits - so security would be at the same level as 3DES.

A better option would be to derive an AES key from the triple DES key. Of course, this also needs to be possible in your HSM and the key must be usable for the key derivation mechanism. That way you would get a different key value, but one that is still linked to the value of the DES key(s).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.