Tools
3DES and AES Calculator
Encrypt or decrypt hex data with Triple DES or AES in ECB or CBC mode, with the padding methods used in payments. Shows the key check value (KCV) and DES key parity.
Runs only in your browser. Nothing is sent anywhere. Use test keys only; never enter production keys or key components into any website.
About the calculator
Which 3DES key lengths are supported?
16-byte double-length keys (K1 K2, used as K1 K2 K1) and 24-byte triple-length keys (K1 K2 K3). An 8-byte key runs single DES, which is shown for testing legacy systems only.
How is the KCV calculated?
The key check value is the first 3 bytes of a block of zeros encrypted with the key in ECB mode. This is the classic method for both 3DES and AES. Some newer AES key management standards use an AES-CMAC based KCV instead, which gives a different value.
Which padding should I use?
EMV secure messaging and MAC calculation use ISO 9797-1 method 2: add 80, then zeros up to the block size. PKCS#7 is common outside payments. Method 1 adds zeros only, so it cannot be removed reliably after decryption; the calculator leaves it in place.
What is DES key parity?
Each byte of a DES key carries a parity bit, and by convention every byte should have an odd number of 1 bits. DES ignores parity when encrypting, but many HSMs reject keys with wrong parity. Use Fix parity to correct it.