I need to use the CVK Key (in key block format) to calculate the CVV2.

In the past, I have always used single keys in variant format for this purpose (CVKa + CVKb), and the calculation procedure is standard (there are also many online calculators that use it).

Now, with the introduction of key block, how has the CVV2 calculation changed?

1 Answer 1


The short answer is that nothing is different. A key encrypted as a key block and a key encrypted under a variant can (theoretically) be used interchangeably, although the particular HSM you’re using may put restrictions on one or the other. In both cases, you never have access to the key itself, just an encrypted value that the HSM can decrypt into the correct key.

If you previously had two single-length keys and now have one double-length one, the calculation is still the same; you just use the first half as CVKa and the second half as CVKb.

So the high level answer is that nothing in CVV2 calculation has changed, the keys are just being secured differently. If you need help figuring out how to actually use the key block, ask a new question and provide some details about your setup (what HSM are you using, what commands are you calling, etc).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .