From: Giuliano Bertoletti on

Hello,

which is the best way to wrap a symmetric key with another symmetric key
along with some keys attributes and apply an integrity check?

Suppose K is an AES key I need to wrap, A is some key attributes, W the
AES key I want to encrypt everything with and | the concatenation operator.

My idea is something like:

M := A | K | SHA256( A | K )

C := AES_CBC( M, IV, W )

Is it ok, or is there a better way to accomplish that?

Giulio.
From: Kristian Gj�steen on
Giuliano Bertoletti <gbe32241(a)libero.it> wrote:
>which is the best way to wrap a symmetric key with another symmetric key
>along with some keys attributes and apply an integrity check?
>
>Suppose K is an AES key I need to wrap, A is some key attributes, W the
>AES key I want to encrypt everything with and | the concatenation operator.

AES-GCM(W, IV, A || K)

GCM is Galois Counter Mode, could be replaced by CCM (CBC with CBC-MAC)
mode.

--
kg