Tools

    Visa PVV calculator

    Generate or verify a Visa PIN verification value, with the decimalisation steps.

    • Runs in your browser
    • No sign-up

    Input

    KCV PVKA D5D44F · KCV PVKB A68CDC

    PVV 4021.

    Result

    PVV
    4021
    Steps
    PAN digits: the 11 rightmost, without the check digit33445566778
    TSP = PAN digits ‖ PVKI ‖ 4 leftmost PIN digits3344556677834524
    TDES(PVK, TSP)4FA0F215CEF557C1
    Decimal digits of the result, left to right402155571
    PVV = first 4 of these digits4021

    Test keys and test PINs only. Production PVKs belong in an HSM, never in a web page.

    PIN verification failing at the issuer? IDNTEQ can trace the PVV inputs. EMV transaction troubleshooting

    About this tool

    Runs in your browser. This page loads no analytics or third-party scripts and does not send what you type.

    Enter a test PVK pair, the PAN, the PVK index and the PIN to get the 4-digit PVV, or switch to Verify to compare a PIN with the PVV on file.

    How the PVV is computed

    The transformed security parameter (TSP) is 16 digits: the 11 rightmost PAN digits without the check digit, the PVKI and the 4 leftmost PIN digits. It is encrypted with TDES under the PVK pair (PVKA ‖ PVKB). The PVV is the first 4 decimal digits of the result, read left to right; when there are fewer than 4, the hex digits A to F are read again, left to right, as 0 to 5.

    To verify, the issuer recomputes the PVV from the PIN entered and compares it with the PVV on the card track or in its database. In production this happens inside an HSM.

    Worked example

    PVK 0123456789ABCDEFFEDCBA9876543210, PAN 1122334455667788, PVKI 3 and PIN 4524 give the TSP 3344556677834524, the encrypted TSP 4FA0F215CEF557C1 and the PVV 4021 (psec example).

    Spec references

    • Visa PIN Verification Value method, as published in the psec library
    • ISO 9564-1 (PIN management and security)

    Verified against

    Specifications
    • Visa PVV method: TSP, TDES under PVKA ‖ PVKB, decimalisation (as published in the psec library)
    Published examples in the tests
    Other checks in the tests
    • 4000 random keys and PANs against OpenSSL TDES and the decimalisation rule, including the A–F path
    • Verify mode, PINs longer than 4 digits, bad inputs
    Inputs
    PVK pair of 16 bytes (or a 24-byte key), PAN of 12–19 digits, PVKI 0–9, PIN of 4–12 digits; to verify, the PVV on file.
    Not covered
    IBM 3624 PIN offsets and other PIN verification methods are not computed.
    Last reviewed