There has been lately a question on KCV (key check value), value provided by many CRYPTOKI (PKCS#11) implementations. I don't particularly like KCV, but I decided to ask about proper use of KCV.
This "KCV" (also known as CKA_CHECK_VALUE object attribute) value is derived as follows:
- For most objects: first three bytes of SHA-1 hash of the object.
- For cryptographic keys for block ciphers, it is the first three octets of ciphertext produced by ECB mode encryption of a block full of zeros.
Sending KCV (key check value) with cipher text is done rarely, because the check does not ensure correctness of the key very well. The excellent answer from poncho to this question Sending KCV (key check value) with cipher text illustrates a few reasons.
My concern is that KCV could jeopardize confidentiality or authenticity of proper usage of some modes of operation:
- CMAC mode uses $k_{0} = E_{k}(0^{128})$ for deriving sub-keys.
- If CTR mode is used starting with counter value 0, that would obviously allow revealing three first bytes.
Is it good idea to avoid using KCV in above situations?
Are there some other modes of operation, where revealing the first octets of encryption of zero block is bad?