Improve testDataSamples: random placeholders and recipeConfig chains

Replace six static inputs that held hardcoded keys or PINs with the
appropriate __RANDOM_*__ placeholder so the populate button delivers a
fresh value each time rather than a fixed test vector:
  - PIN Data Generate, IBM 3624 Generate PIN Offset, VISA PVV Generate
    → __RANDOM_PIN_4__
  - DUKPT Derive TDES Key, AS2805 Generate KEK Validation
    → __RANDOM_TDES_16_HEX__
  - DUKPT Derive AES Key → __RANDOM_AES_128_HEX__

Add a recipeConfig chain sample to two ops where the output of
Key Generate flows directly into the next op as input:
  - Card Validation Data Generate: Key Generate → Card Validation Data Generate
  - Payment Calculate KCV: Key Generate → Payment Calculate KCV

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
J8k3 2026-05-18 10:01:31 -04:00
parent 634c835dfd
commit fc6ac7806e
8 changed files with 20 additions and 6 deletions

View File

@ -29,6 +29,13 @@ class CalculatePaymentKCV extends Operation {
name: "Random AES-CMAC sample",
input: "__RANDOM_AES_128_HEX__",
args: ["Hex", "AES-CMAC (Empty)", 6]
},
{
name: "Generate key then compute KCV",
recipeConfig: [
{ op: "Key Generate", args: ["AES-128 (16 bytes)", 16, false, false] },
{ op: "Payment Calculate KCV", args: ["Hex", "AES-CMAC (Empty)", 6] }
]
}
];
this.infoURL = "https://en.wikipedia.org/wiki/Message_authentication_code";

View File

@ -292,7 +292,7 @@ class DeriveDUKPTAESKey extends Operation {
this.testDataSamples = [
{
name: "Derive IK from BDK",
input: "FEDCBA9876543210F1F1F1F1F1F1F1F1",
input: "__RANDOM_AES_128_HEX__",
args: ["BDK", "Derive IK", "123456789012345600000001", "PIN Encryption", false],
},
];

View File

@ -203,7 +203,7 @@ class DeriveDUKPTKey extends Operation {
this.testDataSamples = [
{
name: "Known transaction key vector",
input: "0123456789ABCDEFFEDCBA9876543210",
input: "__RANDOM_TDES_16_HEX__",
args: ["Derive Session Key", "FFFF9876543210E00008", "None", false]
}
];

View File

@ -54,7 +54,7 @@ class GenerateAS2805KEKValidation extends Operation {
this.testDataSamples = [
{
name: "AS2805 request sample",
input: "0123456789ABCDEFFEDCBA9876543210",
input: "__RANDOM_TDES_16_HEX__",
args: ["KekValidationRequest", "TDES_2KEY", "VARIANT_MASK_82", "", true]
}
];

View File

@ -26,6 +26,13 @@ class GenerateCardValidationData extends Operation {
name: "Known CVV2 test sample",
input: "0123456789ABCDEFFEDCBA9876543210",
args: ["CVV2 / CVC2 (force 000)", "4123456789012345", "02", "25", "MMYY", "101", 3, false]
},
{
name: "Generated CVK → CVV2",
recipeConfig: [
{ op: "Key Generate", args: ["AES-128 (16 bytes)", 16, false, false] },
{ op: "Card Validation Data Generate", args: ["CVV2 / CVC2 (force 000)", "4123456789012345", "02", "25", "MMYY", "101", 3, false] }
]
}
];
this.infoURL = "https://en.wikipedia.org/wiki/Card_security_code";

View File

@ -23,7 +23,7 @@ class GenerateIBM3624PINOffset extends Operation {
this.testDataSamples = [
{
name: "IBM 3624 offset sample",
input: "1234",
input: "__RANDOM_PIN_4__",
args: ["0123456789ABCDEFFEDCBA9876543210", "0123456789012345", "5432101234567890", "F", true]
}
];

View File

@ -23,7 +23,7 @@ class GeneratePaymentPINData extends Operation {
this.testDataSamples = [
{
name: "Format 0 sample",
input: "1234",
input: "__RANDOM_PIN_4__",
args: ["ISO Format 0", "5432101234567890", false, false]
}
];

View File

@ -23,7 +23,7 @@ class GenerateVISAPVV extends Operation {
this.testDataSamples = [
{
name: "VISA PVV sample",
input: "1234",
input: "__RANDOM_PIN_4__",
args: ["0123456789ABCDEFFEDCBA9876543210", "5432101234567890", 1, true]
}
];