How to compute an encryption key using KDF by using AES based CMAC as PRF in .net framework 4.7.1?

1.5k Views Asked by At

I am trying to create an encryption key from a known master key using a key derivation function. The NIST Publication 800-108 contains recommendation for key derivation using pseudorandom functions (PRF). This document has several KDF modes defined in it. I am trying to use KDF in Counter Mode (as outlined in section 5.1). This (as other KDF modes in this spec) use PRF, which according to section 4 can be HMAC or CMAC.

I have all the inputs K, Label. Context and L that can be go into KDF in Counter Mode. I would like to use AES based CMAC as PRF.

How can I compute the following step (i.e. PRF(s, x)) in KDF in Counter Mode using AES based CMAC?

K(i) := PRF (KI, [i]2 || Label || 0x00 || Context || [L]2) which is basically PRF(s, x)

The only reference remotely related to MAC that I found is System.Security.Cryptography.MACTripleDES.

0

There are 0 best solutions below