Add Key Check Value operation#2661
Open
J8k3 wants to merge 1 commit into
Open
Conversation
Verifies that two parties hold the same symmetric key without exposing it. Supports the three standard forms: TDES-ECB (ANSI X9.24-1), AES-ECB, and AES-CMAC of the empty message (RFC 4493 / TR-31 KC block). Test vectors sourced from NIST SP 800-67 Rev 2 and NIST SP 800-38B.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
Key Check Valueoperation to theHashingcategory. A KCV is a short public value derived from a symmetric key so two parties can verify they hold the same key without exposing it — widely used in payment HSM key management (TR-31 / ANSI X9.143 KC blocks) and general symmetric-key handling.Three standard methods:
Returns the leading N hex characters of the resulting cryptogram (default 6, matching typical KCV length).
Notes
node-forgeand the in-treeCMACoperation.Test plan
npm test— all 7 KCV tests pass; no regressions in adjacent ops.npx eslint— clean.