The EFTtools set consist of applications supporting payment transaction service development, testing and benchmarking. It currently consists of following components: Cryptographic Calculator and HSM Commander.
This tutorial focuses on Cryptographic Calculator functionality and is provided in six separated parts as per functionality topics covered by its main menu – Generic, Cipher, Keys, Payments, EMV and Development tools. This tutorial also aspires to provide bits of basic history on algorithms in use.
This set of tools is focuses on working with cryptography algorithms used across payments, extended with further features as MAC generation and validation, PIN formats and calculation and other common payments security techniques.
AS2805 is the Australian standard for financial messaging. It is near-exclusively used in Australia for the operation of card-based financial transactions among banks, automatic teller machines and EFTPOS devices. Financial messages described by this standard are closely related to ISO 8583, but pre-dates it by two years (1985 vs 1987).
AS2805 functionality provided by CCALC handles Terminal Keys Set generation, PIN Block translation, plus MAC and OWF generation.
Generates set of terminal keys like a Terminal PIN Key (TPK), Terminal Authentication Key Receive (TAKr), Terminal Authentication Key Send (TAKs), Terminal Encryption Key Receive (TEKr) and Terminal Encryption Key Send (TEKs) and return each key encrypted under a variant of a Terminal Master Key (TMK) or KMA and the appropriate LMK pair. CCALC generates a key check value (KCV) for every output key.
KEK Flag specifies what key is used 1 = KEK1, 2 = KEK2, 3 = TEKr.
Key Encryption Key receive (KEKr) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32. The key is encrypted under the appropriate variant of LMK pair 14-15.
Key Scheme KEK says what Key Scheme will be used for encrypting keys under KEKr.
Key Scheme LMK says what Key Scheme will be used for encrypting keys under LMK.
KCV Type sets the length of the key check value (1 = KCV 6H )
AS2805: Generate Terminal Key Set operation finished
****************************************
KEK Flag: 1
KEKr: D045461C8C49FC0C9729AC0D5FA0E4E4
Key Scheme KEK: H
Key Scheme LMK: U
Key Check Value Type:1
—————————————-
TPK under LMK: UD6CAF1AF4084B33306684F966F8B73ED
TPK under KEK: HAA25A3709EA011CD59728FD78F259BAF
KCV of TPK: 2D66C2
TAKs under LMK: UC3980C1FA678CBECB1B0B0C6BF905189
TAKr under LMK: U221159822BEC80B177D292005F20DCB8
TAKs under KEK: H8D5C26B2687F5A4805DE2EA05789ECE9
TAKr under KEK: H5E933F6802C36FC31A71DFBF45481E79
KCV of TAKs: C0B4B8
KCV of TAKr: 910A49
TEKs under LMK: U8261BE1B0BABCE128F5B01DE5CC40B98
TEKr under LMK: U5CB533A83C3AB17F0E85FE11BE16AA9B
TEKs under KEK: H14F29CBB9FBF9E2A87130348F2FB5C33
TEKr under KEK: H129C77D9C3F8373B62198AE6505F91C9
KCV of TEKs: 647EEB
KCV of TEKr: C4D177
DES operations count:2
This fuction translates a PIN block from encryption under a PIN Encryption Key (KPE) to encryption under a Zone PIN Key (ZPK). The KPE is derived from a Terminal PIN Key (TPK) and two other values, the Systems Trace Audit Number (STAN) and the transaction amount.
Zone PIN Key (ZPK) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32. The key is encrypted under the variant 0 of LMK pair 06-07.
Terminal PIN Key (TPK) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32. The key is encrypted under the variant 0 of LMK pair 14-15.
Received and Responding PIN Block formats have to be a valid PIN block format code (eg. 01, 46).
ReceivedPIN Block is encrypted under KPE.
Account number provided as last 12 digits from PAN except the check value (12N).
The following diagram demonstrates PIN Block translation from KPE to ZPK and conversion between the PIN Block formats.
AS2805: Translate PIN Block operation finished
****************************************
System ZPK: U16B8E012BF7E66740E7314F50285D100
Terminal TPK: UA342F36E4DD5390FA48833B18AC7D3DE
STAN: 000324
Transaction Amount: 000000000328
In PIN Bl. Format: 46
Out PIN Bl. Format: 1
Incoming PIN Block: 449ECFEA9FBCFE4B
Account Number: 430300010094
—————————————-
Outgoing PIN Block: D191B5DC48D8FD0D
Message Authentication Code (MAC) is generated using Terminal Authentication Key (TAK) as per method defined in AS2805.4 (1985). It takes double length MAC key and applies the procedure on hexadecimal data provided in the Data field.
Key (TAK) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32. Note that the input key is in its plain form (unencrypted).
AS2805: MAC operation finished
****************************************
Key: 9486EB87AC3A4FDD9325A70B97D7D9F8
Data: 02107238000102C000111670343010001006660000000000000000000912065731000092155726091206703400393138303030303230343030303133303039373334202020203032390301000000000020202020202020200000000000000000020000000000
—————————————-
Encrypted MAC: 2DFF2261
The One-way Function (OWF) is a backbone of AS2805 and is used in majority of previous key generation functions. CCALC implementation complies with the AS2805.5.4 standard as it is described below.
Key (TAK) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32. The key is in its plain form (unencrypted).
AS2805: OWF calculation finished
****************************************
Key: 23232323232323234545454545454545
Data: 33334444555566667777888899991111AAAAAAAABBBBB
—————————————-
Calculated OWF: 5026FC017850298D6A037A566251AF84A905F282FEE94
KCV of TEKs: 647EEB
KCV of TEKr: C4D177
DES operations count:2
Support for ISO8583 Bitmap preparation. Parses bitmap (hexadecimal data) into bits and construct a bitmap back from binary data provided. Screen reacts on Enter in Bitmap input and also on each bit-checkbox tick. NOTE: Algorithm detects 1st bit to be set to indicate secondary bitmap presence as per ISO8583 standard.
Card Verification Values – This screen provides facility to generate and validate all major card not present (CNP) values – CVV/iCVV/CVV2(CVC2)/dCVV.
Card Verification Key pair (CVK A/B) has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32H.
Primary Account Number (PAN) according to ISO/IEC 7812.
CNP: Generate verification value operation finished
****************************************
CVK A/B: 0123456789ABCDEFFEDCBA9876543210
PAN: 4999988887777000
Expiration date: 9105
Service Code: 101
—————————————-
Verification value: 539
CNP: Validate verification value operation finished
****************************************
CVK A/B: 0123456789ABCDEFFEDCBA9876543210
Card Verification Val.:539
PAN: 4999988887777000
Expiration date: 9105
Service Code: 101
—————————————-
Validation Status: OK
Card Security Code (AMEX) – This screen provides facility to generate and validate CSC version 1 and version 2. Version 2 supports following verification value types:
CSC Key has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32H.
Primary Account Number (PAN) according to ISO/IEC 7812.
AMEX CSC: Generate security code operation finished
****************************************
CSC Key: 0123456789ABCDEFFEDCBA9876543210
PAN: 371234567890123
Expiration date: 9912
Service Code: 702
Value Type: CSC
—————————————-
CSC-5: 21334
CSC-4: 5068
CSC-3: 221
AMEX CSC: Validate security code operation finished
****************************************
CSC Key: 0123456789ABCDEFFEDCBA9876543210
CSC-5:21334
CSC-4:5068
CSC-3:221
PAN: 371234567890123
Expiration date: 9912
Service Code: 702
Value Type: CSC
—————————————-
CSC-5 validation: PASSED
CSC-4 validation: PASSED
CSC-3 validation: PASSED
Card Verification Value (MasterCard) – This screen provides facility to generate and validate dynamic CVC3 and PIN-CVC3 values.
IMK Key has to be always provided in hexadecimal digits (0-9 | A-F) and key length allowed is 32H.
Primary Account Number (PAN) according to ISO/IEC 7812.
MasterCard dynamic CVC3: Generate verification code operation finished
****************************************
IMK Key: 01234567899876543210012345678998
PAN: 5413123456784808
PAN Seq. N.: 00
Track 1/2: 0000000000000000000000000000000000000000000000000000000000000000
Unpredictable N.: 00000899
ATC: 005E
Type: dynamic CVC3
——————–
Derived Key: 462FC416E0E93D042CD0B00731AB4637
Parity: ODD
Derived Key KCV: AF59
—————————————-
dynamic CVC3: 33204
MasterCard dynamic CVC3: Validate verification code operation finished
****************************************
IMK Key: 01234567899876543210012345678998
PAN: 5413123456784808
PAN Seq. N.: 00
Track 1/2: 0000000000000000000000000000000000000000000000000000000000000000
Unpredictable N.: 00000899
ATC: 005E
Type: dynamic CVC3
——————–
Derived Key: 462FC416E0E93D042CD0B00731AB4637
Parity: ODD
Derived Key KCV: AF59
—————————————-
dynamic CVC3: 33204
dynamic CVC3: PASSED
DUKPT panels consists of tabs following ISO-9797 – IPEK derivation, PEK derivation, PIN encryption and MAC encryption. Method described in ISO-9797 uses Initial Pin Encryption Key (PEK) and Pin Encryption Key (PEK) to encrypt PIN block encryption with unique key per transaction as well as using variant of this key for MAC generation on transaction data provided.
IPEK and PEK derivation functions are the first options available. These require Base Derivation Key (BDK) and Key Serial Number (KSN), or IPEK & KSN for PEK derivation, as input parameters. BKD and IPEK keys are expected to be entered in its hexadecimal form and needs to be double length. The KSN has hexa-decimal digits (0-9 | A-F) and input size has to be 20 characters.
DUKPT: PEK derivation finished
****************************************
BDK: C1D0F8FB4958670DBA40AB1F3752EF0D
KSN: FFFF9876543210E10004
—————————————-
Derived IPEK: 74E912996F1245CC1CF6F5C1E02FD05A
KCV: 18DCD7
Derived PEK: 4EC2A2974ECA53F5691E5273963EBE5C
KCV: 3C2BEF
DUKPT PIN screen allows PIN block encryption/decoding with a PEK key. Input values are similar to previous screens, just note that entered PEK will be XOR-ed with the value of 00000000000000FF 00000000000000FF (see ANSI X9.24-2004 Appendix A, A.5, page 42) as part of the processing. So there is no need to do that operation in advance (it would exactly negate the previous change).
Encryption:
DUKPT: PIN operation finished
****************************************
PEK: 93A497589EBE6781DE37D2CBBDE5D436
PIN block: 04124389999AAAAB
—————————————-
Encrypted PIN: 23CB4612E05DE24D
Decryption:
DUKPT: PIN operation finished
****************************************
PEK: 93A497589EBE6781DE37D2CBBDE5D436
PIN block: 23CB4612E05DE24D
—————————————-
Decoded PIN: 04124389999AAAAB
DUKPT MAC screen takes BDK, KSN and Data fields and outputs ANSI X9.24-2004 MAC with filling option 1. All input fields are expected to be in a hexadecimal format with their appropriate lengths (single/double/triple DEA). Note that the data field size is limited to 8120 characters. The 3DES switch serves to indicate whether the last cryptographic operation applied on hashing value should should be single or triple DES (default).
Entered PEK value will be XOR-ed with the value of 000000000000FF00 000000000000FF00 (see ANSI X9.24-2004 Appendix A, A.5, page 42) as part of the processing.
DUKPT: MAC operation finished
****************************************
PEK: 4EC2A2974ECA53F5691E5273963EBE5C
Data: 30313030f23e069529e08180000000003030373035373030333030333030303939393939393939393939393036323931333236323330303030303431333236323330363239313231323036323930323130303134314330303030303030304330303030303030303034313031353337373430353130303036303030373035373030333d31323132313132373735353131313131343030303030303030303930313131324c5437303633303130303030304c544c543730363330305c5c4b616e74616c69736b6961695c363934383120202020202020204c54552020202020202020203939393030343135313030303333333031363734303531303030363030303730353730313532313031303132313031344331303130303036373760001400000000003130303030303030303930314832486e6455544420202020494453504c202020202020203030303030343030
—————————————-
MAC: 01FE54357EF29DEA
The last screen provides facility to encrypt or decode data with current PEK key. Entered PEK value will be XOR-ed with the data key variant of 0000000000FF0000 0000000000FF0000. (Unchecking Data Variant checkbox will revert to 00000000000000FF 00000000000000FF).
And in order to have a high degree of isolation between the data encrypting key and the PIN key, the data encryption key shall be in this case processed by a OWF before use. The OWF defined here is that the derived variant value is encrypted using itself as the key.
Encryption:
DUKPT: DATA operation finished
****************************************
PEK: 4EC2A2974ECA53F5691E5273963EBE5C
KEY: A4E5BEF08AD403C9AFE3181E424CA0A4
Data: 2542353435323330303535313232373138395E484F47414E2F5041554C2020202020205E30383034333231303030303030303732353030303030303F00000000
—————————————-
Encrypted DATA: 900D314BF59C1E4A25BFD725E12E547F52EEFCFF5C4848591FF8ADB050ADF220E4745D3566503ADFA2A0ECC7D597F6B73D079928E27EFE1C1C59AC4F0A99C9D5
Decryption:
DUKPT: DATA operation finished
****************************************
PEK: 4EC2A2974ECA53F5691E5273963EBE5C
KEY: A4E5BEF08AD403C9AFE3181E424CA0A4
Data: 900D314BF59C1E4A25BFD725E12E547F52EEFCFF5C4848591FF8ADB050ADF220E4745D3566503ADFA2A0ECC7D597F6B73D079928E27EFE1C1C59AC4F0A99C9D5
—————————————-
Decoded DATA: 2542353435323330303535313232373138395E484F47414E2F5041554C2020202020205E30383034333231303030303030303732353030303030303F00000000
Decoded DATA (binary): %B5452300551227189^HOGAN/PAUL ^08043210000000725000000?
DUKPT panels consists of tabs following ANSI X9.24-3-2017 – IPEK derivation, PEK derivation, PIN encryption and MAC encryption.
The standard describes the AES DUKPT algorithm, which is used to derive key(s) from an initial terminal DUKPT key based on the transaction number.
Derived keys can be used for a variety of functions, such as encryption of PINs, data or other keys, for derivation of other keys, for message authentication, etc.
AES DUKPT supports the derivation of AES-128, AES-192, AES-256, and double and triple length TDEA keys from AES-128, AES-192, and AES-256 initial keys.
IPEK and PEK derivation functions are the first options available. These require Base Derivation Key (BDK) and Key Serial Number (KSN), or IPEK & KSN for PEK derivation, as input parameters. BKD and IPEK keys are expected to be entered in its hexadecimal form. The KSN has hexa-decimal digits (0-9 | A-F) and input size has to be 16 to 24 characters.
DUKPT (AES): Working keys derivation finished
****************************************
BDK: FEDCBA9876543210F1F1F1F1F1F1F1F1
KSN: 123456789012345600000005
—————————————-
Initial Key: 1273671EA26AC29AFA4D1084127652A1
KSN (working): 123456789012345600000005
Transaction Counter: 00000005
Initial Key Id: 1234567890123456
—————————————-
PIN Encryption Key: 35A43BC9EFEB09C756204B57E3FB7D4D
Msg. Auth. Gen. Key: 0588185FE1FF8C7E22FAD78C1C61F065
Msg. Auth. Ver. Key: 75923E6509A80723C60DB75884F4C984
M. Auth. Both Ways Key: 082FAFAAC478050328DE6F3725EFE4B4
Data Encr. Encrypt Key: CA02DF6F30B39E14BD0B4A30E460920F
Data Encr. Decrypt Key: 666F64FBA90777C17DF22C0BF2D1142F
D. Encr. Both Ways Key: 948BE71B8C8DD81362C88061D462A946
Key Encryption Key: 507838E817F32B6D75151FC9E8EF1A80
Key Derivation Key: E61C7FB544669AF1E49D8264FF8E3979
DUKPT PIN screen allows PIN block encryption/decoding with a PEK key.
Encryption:
DUKPT (AES): PIN operation finished
****************************************
PEK: 35A43BC9EFEB09C756204B57E3FB7D4D
PIN block: 04124389999AAAABAAAAAAAAAAAAAAAA
—————————————-
Encrypted PIN: AD444123078A462677E5718CDD833280
Decryption:
DUKPT (AES): PIN operation finished
****************************************
PEK: 35A43BC9EFEB09C756204B57E3FB7D4D
PIN block: AD444123078A462677E5718CDD833280
—————————————-
Decoded PIN: 04124389999AAAABAAAAAAAAAAAAAAAA
DUKPT MAC screen takes BDK, KSN and Data fields and outputs ANSI X9.24-3-2017 MAC. All input fields are expected to be in a hexadecimal format with their appropriate lengths. Note that the data field size is limited to 8120 characters.
DUKPT (AES): MAC operation finished
****************************************
MAC Key: 0588185FE1FF8C7E22FAD78C1C61F065
Data: 30313030f23e069529e08180000000003030373035373030333030333030303939393939393939393939393036323931333236323330303030303431333236323330363239313231323036323930323130303134314330303030303030304330303030303030303034313031353337373430353130303036303030373035373030333d31323132313132373735353131313131343030303030303030303930313131324c5437303633303130303030304c544c543730363330305c5c4b616e74616c69736b6961695c363934383120202020202020204c54552020202020202020203939393030343135313030303333333031363734303531303030363030303730353730313532313031303132313031344331303130303036373760001400000000003130303030303030303930314832486e6455544420202020494453504c202020202020203030303030343030
—————————————-
MAC: 91F061EDC15B3EBC
The last screen provides facility to encrypt or decode data with current PEK key.
Encryption:
DUKPT (AES): DATA operation finished
****************************************
DEK: CA02DF6F30B39E14BD0B4A30E460920F
Data: 900D314BF59C1E4A25BFD725E12E547F52EEFCFF5C4848591FF8ADB050ADF220E4745D3566503ADFA2A0ECC7D597F6B73D079928E27EFE1C1C59AC4F0A99C9D5
—————————————-
Encrypted DATA (hexdec): C5ECF7D9A76A37B1D352148DA24FB85018D7D9F00ACC2918CAAD0B3F856449620283BF26EA7DE5F71695BBF03545654161CAD5C17E0B9B03688986F1C8F043B6
Decryption:
DUKPT (AES): DATA operation finished
****************************************
DEK: CA02DF6F30B39E14BD0B4A30E460920F
Data: C5ECF7D9A76A37B1D352148DA24FB85018D7D9F00ACC2918CAAD0B3F856449620283BF26EA7DE5F71695BBF03545654161CAD5C17E0B9B03688986F1C8F043B6
—————————————-
Decoded DATA (hexdec): 900D314BF59C1E4A25BFD725E12E547F52EEFCFF5C4848591FF8ADB050ADF220E4745D3566503ADFA2A0ECC7D597F6B73D079928E27EFE1C1C59AC4F0A99C9D5
Decoded DATA (ASCII): 900D314BF59C1E4A25BFD725E12E547F52EEFCFF5C4848591FF8ADB050ADF220E4745D3566503ADFA2A0ECC7D597F6B73D079928E27EFE1C1C59AC4F0A99C9D5
ISO/IEC 9797-1 MACs screen supports MAC generation algorithms specified in ISO-9797-1. Supported algorithms are:
ANSI X9.9 MAC screen is for message authentication code (MAC) generation as described in ANSI X9.9 specification. This is reasonably old retail banking technique which still proves to be very fast and protects data consistency along its way between POS and transaction acquirer.
Screen gets single length DEA cryptographic key and hexadecimal data and outputs MAC.
ANSI MAC operation finished
****************************************
Algorithm: ANSI MAC X9.9 (Wholesale MAC)
Key (K) : 0123456789ABCDEF
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
Data (padded): 4E6F77206973207468652074696D6520666F7220616C6C20
Truncation: 4
—————————————-
MAC: 70A30640CC76DD8B
Truncated MAC: 70A30640
ANSI X9.19 is yet another banking standard created by the ANSI X9 working group and published by the American Bankers Association. X9.19 is essentially an update of ANSI X9.9, with a few minor changes to deal with the change from wholesale banking in X9.9 to retail banking in X9.19.
ANSI X9.19 MAC generator uses ANSI 9.19 (ISO/IEC 9797-1, algorithm 3) with padding method 1 algorithm for generating message authentication code in payments industry. It takes two single length DEA keys and applies procedure described in ANSI X9.19 MAC on hexadecimal data provided in the Data field.
ANSI MAC operation finished
****************************************
Algorithm: ANSI MAC X9.19 (Retail MAC)
Key (K) : 0123456789ABCDEF
Key (K’): FEDCBA9876543210
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
Data (padded): 4E6F77206973207468652074696D6520666F7220616C6C20
Truncation: 4
—————————————-
MAC: A1C72E74EA3FA9B6
Truncated MAC: A1C72E74
AS2805 MACs screen supports two MAC alogorithms specified in AS2805.4.1 (MAC Method 1)
AS2805.4.1 MAC operation finished
****************************************
Algorithm: AS2805.4.1 MAC Method 1
Key (K): 0123456789ABCDEFFEDCBA9876543210
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
Data (padded): 4E6F77206973207468652074696D6520666F7220616C6C20
Truncation: 4
—————————————-
MAB: 93462A6DB9B4A4D1
MAC: 93462A6D
AS2805.4.1 MAC operation finished
****************************************
Algorithm: AS2805.4.1 MAC Method 2
Key (KL): 0123456789ABCDEF
Key (KR): FEDCBA9876543210
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
Data (padded): 4E6F77206973207468652074696D6520666F7220616C6C20
Truncation: 4
—————————————-
MAB: A1C72E74EA3FA9B6
MAC: A1C72E74
TDES CBC-MAC – A cipher block chaining message authentication code (CBC-MAC) is a technique for constructing a message authentication code from a block cipher. The message is encrypted with some block cipher algorithm in CBC mode to create a chain of blocks such that each block depends on the proper encryption of the previous block. This interdependence ensures that a change to any of the plaintext bits will cause the final encrypted block to change in a way that cannot be predicted or counteracted without knowing the key to the block cipher.
TDES MAC operation finished
****************************************
Algorithm: TDES CBC-MAC
Key (K): 0123456789ABCDEFFEDCBA9876543210
Padding: ISO9797-1 (Padding method 1)
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
Data (padded): 4E6F77206973207468652074696D6520666F7220616C6C20
Truncation: 4
—————————————-
MAC: 93462A6DB9B4A4D1
Truncated MAC: 93462A6D
In cryptography, an HMAC (sometimes expanded as either keyed-hash message authentication code or hash-based message authentication code) is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message.
HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, in combination with a secret shared key.
The cryptographic strength of HMAC depends on the properties of the underlying hash function.
HMAC SHA-256: operation finished
****************************************
Key: 0123456789ABCDEFFEDCBA9876543210
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
—————————————-
HMAC: 4B9C609944D6F0F7C3AAC555EBDB5420048CC1123E7F113AAD781ABF290F18ED
CMAC (Cipher-based Message Authentication Code) is a block cipher-based message authentication code algorithm. It may be used to provide assurance of the authenticity and, hence, the integrity of binary data. This mode of operation fixes security deficiencies of CBC-MAC (CBC-MAC is secure only for fixed-length messages).
CMAC (AES): operation finished
****************************************
Key: 2B7E151628AED2A6ABF7158809CF4F3C
Data: 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
—————————————-
CMAC: 51F0BEBF7E3B9D92FC49741779363CFE
On this screen you may manually simulate, with using combination of input parameters, the:
Retail MAC operation finished
****************************************
Key: 0123456789abcdefFEDCBA9876543210
Algorithm: DES
Finalize: None
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
—————————————-
MAC: 70A30640CC76DD8B
Retail MAC operation finished
****************************************
Key: 0123456789abcdefFEDCBA9876543210
Algorithm: DES
Finalize: 3DES
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
—————————————-
MAC: A1C72E74EA3FA9B6
Retail MAC operation finished
****************************************
Key: 0123456789abcdefFEDCBA9876543210
Algorithm: 3DES
Finalize: None
Data: 4E6F77206973207468652074696D6520666F7220616C6C20
—————————————-
MAC: 93462A6DB9B4A4D1
BP-CryptoCalc handles PIN block encoding and decoding for all most common PIN block formats:
The first option picks a format. Other input fields are Primary Account Number (PAN) and Personal Identification Number (PIN) for encoding operation, where fields PIN block and PAN are needed for decoding operation. PAN field length is limited to numbers and size 13..19, PIN field takes 4 up to 12 digits and PIN block takes 16 hexadecimal values only. For some algorithms the Padding character is needed.
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
—————————————-
Clear PIN block: 0412AC89ABCDEF67
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 0412AC89ABCDEF67
PAN: 43219876543210987
—————————————-
Decoded PIN: 1234
AES (Advanced Encryption Standard) OLP Format 4 encryption. This screen provided the encryption to and decoding from the PIN Block format 4.
AES OLP PIN Block Format 4 operation finished
****************************************
Key: C1D0F8FB4958670DBA40AB1F3752EF0D
PIN: 56798
PIN Block: 4556798AAAAAAAAAC8BC2AE3BAAAB916
PAN: 432198765432109870
PAN Block: 64321987654321098700000000000000
Mode: AES-ECB
—————————————-
Intermediate Block A: 235CF89BDD6D9EA9A7DBEC50A583AA7C
Intermediate Block B: 476EE11CB82EBFA020DBEC50A583AA7C
—————————————-
Encrypted PIN Block: 31A033E822A05EACEF025611999014B4
AES OLP PIN Block Format 4 operation finished
****************************************
Key: C1D0F8FB4958670DBA40AB1F3752EF0D
PIN Block: 31A033E822A05EACEF025611999014B4
PAN: 432198765432109870
PAN Block: 64321987654321098700000000000000
Mode: AES-ECB
—————————————-
Intermediate Block B: 476EE11CB82EBFA020DBEC50A583AA7C
Intermediate Block A: 235CF89BDD6D9EA9A7DBEC50A583AA7C
—————————————-
Decoded PIN Block: 4556798AAAAAAAAAC8BC2AE3BAAAB916
PIN: 56798
PAN: 432198765432109870
To allow the customer to select his own PIN, a PIN offset is used by the IBM 3624 PIN generation algorithm to relate the customer-selected PIN to the generated PIN.
The PIN offset generation algorithm requires two parameters in addition to those used in the 3624 PIN generation algorithm. They are a customer-selected PIN and a 4-bit PIN check length. The length of the customer-selected PIN is equal to the assigned-PIN length.
The offset data value is the result of subtracting (modulo 10) the leftmost n digits of the intermediate PIN from the customer-selected PIN.
PIN offset (IBM 3624 Method): PIN offset derivation finished
****************************************
PVK: 0123456789ABCDEFFEDCBA9876543210
PAN: 1234567899876543
PIN: 3196
Decimalisation table: 0123456789012345
Validation Data: 0000000N0000
—————————————-
Intermediate PIN: 3196
PIN Offset: 0000
Functionality of this screen generates a n-digit PIN based on 3624 PIN Generation Algorithm. Inputs are Pin Derivation Key, PAN, PIN and decimalisation table. The assigned PIN offset length parameter is hardcoded = 4.
PIN offset (IBM 3624 Method): PIN offset validation finished
****************************************
PVK: 0123456789ABCDEFFEDCBA9876543210
PAN: 1234567899876543
PIN offset: 0000
Decimalisation table: 0123456789012345
PAD char: F
—————————————-
Native PIN: 3196
PIN: 3196
The VISA method generates a PIN verification value (PVV). Similar to the offset value, it can be stored on the card’s track data, or in a database at the card issuer. This is called the reference PVV.
The VISA method takes the rightmost eleven digits of the PAN excluding the checksum value, a PIN validation key index (PVKI, chosen from one to six) and the required PIN value to make a 64 bit number, the PVKI selects a validation key (PVK, of 128 bits) to encrypt this number. From this encrypted value, the PVV is found.
To validate the PIN, the issuing bank calculates a PVV value from the entered PIN and PAN and compares this value to the reference PVV. If the reference PVV and the calculated PVV match, the correct PIN was entered.
Unlike the IBM method, the VISA method doesn’t derive a PIN. The PVV value is used to confirm the PIN entered at the terminal, was also used to generate the reference PVV. The PIN used to generate a PVV can be randomly generated or user selected or even derived using the IBM method.
This algorithm generates a 4-digit PVV. Inputs are Pin Derivation Key, PAN, PIN and PIN Verification Key Indicator (PVKI). The assigned PVV length parameter is hardcoded = 4.
PIN PVV: PIN PVV derivation finished
****************************************
PVK: 0123456789ABCDEFFEDCBA9876543210
PAN: 1234567899876543
PIN: 1234
PVKI: 1
—————————————-
PVV: 9365
PIN PVV: PIN extraction finished
****************************************
PVK: 0123456789ABCDEFFEDCBA9876543210
PAN: 1234567899876543
PVV: 9365
PVKI: 1
—————————————-
PIN: 1234
Issuer Signing Request Validation – parses data in file provided, decodes self-signing certificate and validates certificate signature.
Signed Issuer Public Key Data Validation – parses data in file provided, decodes Signed Issuer Public Key Data and validates certificate signature with CA PK.
Issuer Certificate Validation
****************************************
Reading CA Public Key File
—————————————-
File: None
Header: 22
Length Modulus PK Issuer: B0(1408)
Modulus PK Issuer: E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C17D7B2E08871B2E069C67918CEE508F89F56585F57ECF2896B5CF3B57DC48AB08D69366769D6D07D1
Length Exponent PK Issuer: 01(8)
Exponent PK Issuer: 03
Tracking Number: 982189
Enc Data: AFB775FA5C596F9A5105D82399682C8C7E7F4D63ED51DB500409AC3DEF0546B740E9339657A2F2B90A82BC8ABFBD935FF1EABDDF1E091FA0DE6314B4CBEFC326F46FA7631021D90E96B2A32F38B242E852B7DE54A0B6A2C9D1D08624262BB00B02D00A88ED417B193EAB6A15EBA8F3286F0F59C00AFE6E9DC50E15AFF480EAF06A1B3A09A5E5703050ED8F6FCEA96A4EF4E6C9BDDDD8661FF4BD4929A364D700C6F9874A2EC5695DEE8EC9F2255973CE
Hash Data: AFB775FA5C596F9A5105D82399682C8C7E7F4D63ED51DB500409AC3DEF0546B740E9339657A2F2B90A82BC8ABFBD935FF1EABDDF1E091FA0DE6314B4CBEFC326F46FA7631021D90E96B2A32F38B242E852B7DE54A0B6A2C9D1D08624262BB00B02D00A88ED417B193EAB6A15EBA8F3286F0F59C00AFE6E9DC50E15AFF480EAF06A1B3A09A5E5703050ED8F6FCEA96A4EF4E6C9BDDDD8661FF4BD4929A364D700C6F9874A2EC5695DEE8EC9F2255973CE
Dec Data: 231010000002445513FF12229821890101B001E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C10337D171620210D61A00032B667B80F68F271B35AF
—————————————-
Validating Self-Signed Issuer Public Key Data
—————————————-
Header: 23
Service Identifier: 10100000
Certificate Format: 02
Expiration Date: 1222
Tracking Number: 982189
Hash Algorithm Id: 01
PK Algorithm Id: 01
Length Modulus PK Issuer: B0(1408)
Length Exponent PK Issuer: 01(8)
PK Leftmost Portion: E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C1
Exponent: 03
Hash: 37D171620210D61A00032B667B80F68F271B35AF
Hash validation passed
—————————————-
Result: Validation Successful
Issuer Signed Data file Validation
****************************************
Reading Issuer’s Public Key Certificate
—————————————-
File: None
Header: 20
Service Identifier: 10100000
Length Modulus PK CA: B0(1408)
Length Exponent PK CA: 01
PK Algorithm Id: 01
RID: A000000003
PKI: 92
Modulus PK CA: 996AF56F569187D09293C14810450ED8EE3357397B18A2458EFAA92DA3B6DF6514EC060195318FD43BE9B8F0CC669E3F844057CBDDF8BDA191BB64473BC8DC9A730DB8F6B4EDE3924186FFD9B8C7735789C23A36BA0B8AF65372EB57EA5D89E7D14E9C7B6B557460F10885DA16AC923F15AF3758F0F03EBD3C5C2C949CBA306DB44E6A2C076C5F67E281D7EF56785DC4D75945E491F01918800A9E2DC66F60080566CE0DAF8D17EAD46AD8E30A247C9F
Exponent PK CA: 03
Hash: 429C954A3859CEF91295F663C963E582ED6EB253
Enc Data: 7D639B3ACAFB00DF0E25CB760CF28E25309E3E3D9C863521F68473F5506C1BF9303E84AEF9E807BCE9BA024C4972643F300A82F0275E06C94461964007F9D87DEA36C12450EDC27B5AAF455AA492A2996FD72EE15DF488464B06C0BCC6D9A63B9A7463409EF019E5F074C62C33F85C192913DEE3B4A05AE7E3021A6DD36E1D25B402B49680A5FE8B041EAB95A79DA58DC1D5249A2C69A86A18CA6ED8B8D242BD46956F62CED5020D8BBD4F4799B72CA8
Dec Data: 2110100000A00000000392122201996AF56F569187D09293C14810450ED8EE3357397B18A2458EFAA92DA3B6DF6514EC060195318FD43BE9B8F0CC669E3F844057CBDDF8BDA191BB64473BC8DC9A730DB8F6B4EDE3924186FFD9B8C7735789C23A36BA0B8AF65372EB57EA5D89E7D14E9C7B6B557460F10885DA16AC923F15AF3758F0F03EBD3C5C2C949CBA306DB44E6A2C076C5F67E281D7010103429C954A3859CEF91295F663C963E582ED6EB253
Validating Self-Signed CA Public Key Data
—————————————-
Header: 21
Service Identifier: 10100000
RID: A000000003
PKI: 92
Expiration Date: 1222
Length Exponent PK CA: 01
Hash Algorithm Id: 01
PK Algorithm Id: 01
PK Leftmost Portion: 996AF56F569187D09293C14810450ED8EE3357397B18A2458EFAA92DA3B6DF6514EC060195318FD43BE9B8F0CC669E3F844057CBDDF8BDA191BB64473BC8DC9A730DB8F6B4EDE3924186FFD9B8C7735789C23A36BA0B8AF65372EB57EA5D89E7D14E9C7B6B557460F10885DA16AC923F15AF3758F0F03EBD3C5C2C949CBA306DB44E6A2C07
Hash: 429C954A3859CEF91295F663C963E582ED6EB253
Hash input: A00000000392996AF56F569187D09293C14810450ED8EE3357397B18A2458EFAA92DA3B6DF6514EC060195318FD43BE9B8F0CC669E3F844057CBDDF8BDA191BB64473BC8DC9A730DB8F6B4EDE3924186FFD9B8C7735789C23A36BA0B8AF65372EB57EA5D89E7D14E9C7B6B557460F10885DA16AC923F15AF3758F0F03EBD3C5C2C949CBA306DB44E6A2C076C5F67E281D7EF56785DC4D75945E491F01918800A9E2DC66F60080566CE0DAF8D17EAD46AD8E30A247C9F03
Hash validation passed
Reading Done
Reading Issuer’s Certificate Output File
—————————————-
File: None
Header: 24
Service Identifier: 10100000
Issuer ID Number: 445513FF
Certificate Serial Number: 033524
Certificate Expiration Date: 1222
IPK Remainder Length: 24
IPK Remainder: 871B2E069C67918CEE508F89F56585F57ECF2896B5CF3B57DC48AB08D69366769D6D07D1
IPK Exponent Length: 01
IPK Exponent: 03
CA PK Index: 92
Enc Data: 0D75783A2E42CFA88A2F4B4DB635F9798D08D776038FC4B446715A6840C6A88D387051F5F2A73FB6D18284832C4AA382BBDC98DD8AED40AE00D93B9ECEB0ABF9FBAE2D2C0F7416AC561DD3F71BBB388D6528B8B4DC585F72C4A7E8A94494598A1EB0D2465B743073FBA95860BF2D78ECF96D3F3EE8993FD2A87F0121C523F4E07C4913298E7072557925CEC901F89D519F22478AFCC649BB3582794A3AD28BC79AF8C4F43C6D88A99A5DA9C03DBA18F76328B88DDE26F91D6C4D3CA70331525DAF4AADAB187413BFDDD93BBE1C9C672C218928283F179B863A6962D38D5CC3AC1330707E3125E2B978997445ED88363957DF9E170D86E992E5F57526F10C11904F37338A194678361F73611327282FD373C72B57C07D9778A89D83AAAA21B808D5AD69B91DE08A27DB4796185AAE5823E9B0007FE0ABBE2A44D924F2722896D704FA4F05B8D17856999274DDC7E74AAEABB96B33CFB79EE6E7B14B64FAE1A3EC
Reading Done
Validating Signed Issuer Public Key Data
—————————————-
Dec Data: 6A02445513FF12220335240101B001E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C17D7B2E081437ACD494A38DE22C54FF26D1A5845AF90FB280BC
Header: 6A
Certificate Format: 02
Issuer ID Number: 445513FF
Certificate Expiration Date: 1222
Certificate Serial Number: 033524
Hash Algorithm Id: 01
PK Algorithm Id: 01
Length PK Issuer: B0(1408)
Length Exponent PK Issuer: 01
Issuer PK Certificate: E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C17D7B2E08
Hash: 1437ACD494A38DE22C54FF26D1A5845AF90FB280
Trailer: BC
Hash input: 02445513FF12220335240101B001E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C17D7B2E08871B2E069C67918CEE508F89F56585F57ECF2896B5CF3B57DC48AB08D69366769D6D07D103
Hash validation passed
Validating Detached Signature
—————————————-
Enc Data: 6328B88DDE26F91D6C4D3CA70331525DAF4AADAB187413BFDDD93BBE1C9C672C218928283F179B863A6962D38D5CC3AC1330707E3125E2B978997445ED88363957DF9E170D86E992E5F57526F10C11904F37338A194678361F73611327282FD373C72B57C07D9778A89D83AAAA21B808D5AD69B91DE08A27DB4796185AAE5823E9B0007FE0ABBE2A44D924F2722896D704FA4F05B8D17856999274DDC7E74AAEABB96B33CFB79EE6E7B14B64FAE1A3EC
Dec Data: 0001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003021300906052B0E03021A050004149CCC96186581F10ED468ED76E78B3F4C97F7C244
Header: 00
Block Format Code : 01
Padding Characters: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Separator: 00
PKCS#1 Value D Format: 3021300906052B0E03021A05000414
Hash: 9CCC96186581F10ED468ED76E78B3F4C97F7C244
Hash input: 2410100000445513FF033524122224871B2E069C67918CEE508F89F56585F57ECF2896B5CF3B57DC48AB08D69366769D6D07D10103926A02445513FF12220335240101B001E103EC0217E385D60E3C470893DA4AD73A7EE32E20128D6C993EE2D7CB5C1072CC7E13D262AC0F1099D3A8FCBAB8EE1100B021D3FAE183F367443E5D6E2F339C7616160F7A22CD10E9DA263F734B1164AACD2D47579AD1F1338813AFD851D0CA3171B70C6E4C860766827BBCDD2CAB8907078051A39AFFAEED25624D635F54E4C8012CB96D9983C17D7B2E081437ACD494A38DE22C54FF26D1A5845AF90FB280BC
Hash validation passed
—————————————-
Result: Validation Successful
German banks created their own standard very similar to DUKPT. BP-CryptoCalc allows ZKA Session key derivation and also PIN-block encryption and decryption.
ZKA: Session key derivation finished
****************************************
MK: 67676767676767672323232323232323
CM: 00004D000341000000004D0003210000
Rnd: 0123456789ABCDEFFEDCBA9876543210
—————————————-
SK: 38A4524C5823C2FE920220CE51E9610B
KCV: 4B9454
ZKA: PIN decode operation finished
****************************************
SK-pac: 38A4524C5823C2FE920220CE51E9610B
PIN block: 04124389999AAAAB
—————————————-
Encrypted PIN: 9DBE4865B4D37F6D
ZKA: PIN decode operation finished
****************************************
SK-pac: 38A4524C5823C2FE920220CE51E9610B
PIN block: 9DBE4865B4D37F6D
—————————————-
Decoded PIN: 04124389999AAAAB
In this article, we went through the functionality of Cryptographic Calculator covered by the Payments Menu.
Cryptographic Calculator and other tools covered in EFTtools suite were designed to help and assist payment industry people in their day to day tasks and make their work the most effective. Our team would be grateful if you would suggest any improvements to our applications or report completely new functionality needed. Feedback from our users like this is exactly what drives the development of its and helps us to share our experience to wide public.