I would like to implement domain separation in encryption/decryption along with MAC.
The encryption algorithms consists of XChaCha20,XSalsa20,SM4 From China and MAC algorithms consist of HMAC-SHA512 and Poly1305.
Some proposed the following for domain separation encryption and decryption.
- Have 2 variables, EKey and MKey.
- Create 2 new variables, NewEKey and NewMKey.
- NewEKey = Blake2B(EKey,MKey) [Keyed Hash]
- NewMKey = Blake2B(NewEKey,MKey) [Keyed Hash]
Are there any security issues if NewEKey and NewMKey were used for encryption and computing MAC instead of just using EKey and MKey? How would an actual secure domain separation in encryption and MAC computation works?
By using Blake2B to hash this value and put this corresponding value into a MAC algorithm, can this be good or it's a unnecessary operation?
– Hern Mar 21 '23 at 00:27