Consider the following authenticate-and-encrypt scheme that uses AES-128 in CBC mode for encryption and AES-128 - based CMAC for authentication:
- Two keys are derived from the master key k (16 byte):
SHA256(k) = k1 || k2
(k1 and k2 are each 16 byte long) - The plaintext x is encrypted using AES-128 and key k1:
E_k1(x) = c
- The CMAC is computed using AES-128 and key k2:
CMAC_k2(x) = m
- The result is the concatenation of the ciphertext and the MAC:
c||m
We are asked to use this method and I am wondering if there are any problems with deriving the keys for the encryption and the MAC using SHA256 hash?
(I am aware of the discussion around authenticate-then-encrypt vs. encrypt-then-authenticate vs. authenticate-and-encrypt)