Funzioni specifiche di Mastercard - AWS Crittografia dei pagamenti

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Funzioni specifiche di Mastercard

DCVC3

DCVC3 è antecedente agli CVN12 schemi EMV CSK e Mastercard e rappresenta un altro approccio all'utilizzo delle chiavi dinamiche. A volte viene riutilizzato anche per altri casi d'uso. In questo schema, gli input sono dati PAN, PSN, Track1/Track2, un numero imprevedibile e un contatore di transazioni (ATC).

Crea chiave

$ aws payment-cryptography create-key --exportable --key-attributes KeyAlgorithm=TDES_2KEY,KeyUsage=TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS,KeyClass=SYMMETRIC_KEY,KeyModesOfUse='{DeriveKey=true}' --tags='[{"Key":"KEY_PURPOSE","Value":"DCVC3"},{"Key":"CARD_BIN","Value":"12345678"}]'

La risposta richiama i parametri della richiesta, tra cui un ARN per le chiamate successive e un Key Check Value (KCV).

{ "Key": { "KeyArn": "arn:aws:payment-cryptography:us-east-2::key/hrh6qgbi3sk4y3wq", "KeyAttributes": { "KeyUsage": "TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS", "KeyClass": "SYMMETRIC_KEY", "KeyAlgorithm": "TDES_2KEY", "KeyModesOfUse": { "Encrypt": false, "Decrypt": false, "Wrap": false, "Unwrap": false, "Generate": false, "Sign": false, "Verify": false, "DeriveKey": true, "NoRestrictions": false } }, "KeyCheckValue": "08D7B4", "KeyCheckValueAlgorithm": "ANSI_X9_24", "Enabled": true, "Exportable": true, "KeyState": "CREATE_COMPLETE", "KeyOrigin": "AWS_PAYMENT_CRYPTOGRAPHY", "CreateTimestamp": "2024-03-07T06:41:46.648000-07:00", "UsageStartTimestamp": "2024-03-07T06:41:46.626000-07:00" } }

Prendi nota di KeyArn ciò che rappresenta la chiave, ad esempio arn:aws:payment-cryptography:us-east-2: :key/hrh6qgbi3sk4y3wq. Ne hai bisogno nel passaggio successivo.

Genera un DCVC3

Sebbene DCVC3 possa essere generato da una chip card, può anche essere generato manualmente, come in questo esempio

$ aws payment-cryptography-data generate-card-validation-data --key-identifier arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk --primary-account-number=5413123456784808 --generation-attributes DynamicCardVerificationCode='{ApplicationTransactionCounter=0000,TrackData=5241060000000069D13052020000000000003F,PanSequenceNumber=00,UnpredictableNumber=00000000}''
{ "KeyArn": "arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk", "KeyCheckValue": "08D7B4", "ValidationData": "865" }

Convalida il DCVC3

In questo esempio, convalideremo un. DCVC3 Nota che ATC dovrebbe essere fornito come numero esadecimale, ad esempio un contatore di 11 dovrebbe essere rappresentato come 000B. Il servizio prevede un valore a 3 cifre DCVC3, quindi se hai memorizzato un valore di 4 (o 5) cifre, tronca semplicemente i caratteri a sinistra fino a ottenere 3 cifre (ad esempio 15321 dovrebbe avere un valore dei dati di convalida pari a 321).

Se AWS Payment Cryptography è in grado di convalidare, viene restituito un http/200. Se il valore non è convalidato, restituirà una risposta http/400.

$ aws payment-cryptography-data verify-card-validation-data --key-identifier arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk --primary-account-number=5413123456784808 --verification-attributes DynamicCardVerificationCode='{ApplicationTransactionCounter=000B,TrackData=5241060000000069D13052020000000000003F,PanSequenceNumber=00,UnpredictableNumber=00000001}' --validation-data 398
{ "KeyArn": "arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk", "KeyCheckValue": "08D7B4" }

ARQC -/ CVN14CVN15

CVN14 e CVN15 utilizza il metodo EMV CSK di derivazione delle chiavi. I dati esatti delle transazioni variano tra questi due metodi: consulta la documentazione dello schema per i dettagli sulla costruzione del campo dei dati delle transazioni.

ARQC -/ CVN12CVN13

CVN12 e CVN13 sono un vecchio metodo specifico di MasterCard per le transazioni EMV che incorporano un numero imprevedibile nella derivazione per transazione e utilizzano anche un payload diverso. Per informazioni sul contenuto del payload, si prega di contattare lo schema.

Crea chiave

$ aws payment-cryptography create-key --exportable --key-attributes KeyAlgorithm=TDES_2KEY,KeyUsage=TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS,KeyClass=SYMMETRIC_KEY,KeyModesOfUse='{DeriveKey=true}' --tags='[{"Key":"KEY_PURPOSE","Value":"CVN12"},{"Key":"CARD_BIN","Value":"12345678"}]'

La risposta richiama i parametri della richiesta, tra cui un ARN per le chiamate successive e un Key Check Value (KCV).

{ "Key": { "KeyArn": "arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk", "KeyAttributes": { "KeyUsage": "TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS", "KeyClass": "SYMMETRIC_KEY", "KeyAlgorithm": "TDES_2KEY", "KeyModesOfUse": { "Encrypt": false, "Decrypt": false, "Wrap": false, "Unwrap": false, "Generate": false, "Sign": false, "Verify": false, "DeriveKey": true, "NoRestrictions": false } }, "KeyCheckValue": "08D7B4", "KeyCheckValueAlgorithm": "ANSI_X9_24", "Enabled": true, "Exportable": true, "KeyState": "CREATE_COMPLETE", "KeyOrigin": "AWS_PAYMENT_CRYPTOGRAPHY", "CreateTimestamp": "2024-03-07T06:41:46.648000-07:00", "UsageStartTimestamp": "2024-03-07T06:41:46.626000-07:00" } }

Prendi nota di KeyArn ciò che rappresenta la chiave, ad esempio arn:aws:payment-cryptography:us-east-2: :key/pw3s6nl62t5ushfk. Ne hai bisogno nel passaggio successivo.

Convalida l'ARQC

In questo esempio, convalideremo un ARQC generato utilizzando Mastercard. CVN12

Se AWS Payment Cryptography è in grado di convalidare l'ARQC, viene restituito un http/200. Se l'arqc non è convalidato, restituirà una risposta http/400.

$ aws payment-cryptography-data verify-auth-request-cryptogram --auth-request-cryptogram 31BE5D49F14A5F01 \ --key-identifier arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk \ --major-key-derivation-mode EMV_OPTION_A \ --transaction-data 0000000015000000000000000840000000000008402312120197695905 \ --session-key-derivation-attributes='{"Mastercard":{"PanSequenceNumber":"01" \ ,"PrimaryAccountNumber":"9137631040001422","ApplicationTransactionCounter":"000B","UnpredictableNumber":"34343434"}}'
{ "KeyArn": "arn:aws:payment-cryptography:us-east-2::key/pw3s6nl62t5ushfk", "KeyCheckValue": "08D7B4" }