atm-crypto-helpers
v0.2.1
Published
Crypto helper functions for Atm/Pos devices
Downloads
3
Readme
atm-crypto-helpers
Crypto helper functions for Atm/Pos devices
Master (Card) key derivation
Parameters
emvVersion - one of 4.0, 4.1, 4.2, 4.3
- 4.0 - same as option A of the other versions
- 4.1, 4.2, 4.3 - two options for each one, depending on the type parameter:
- option A - same as 4.0
- option B - available for emvVersion 4.1, 4.2 and 4.3
NOTE: Thales Payshield command KQ supports only emvVersion 4.0, therefore option A
Session key derivation
Parameters
- emvVersion - one of 4.0, 4.1, 4.2, 4.3
- 4,0, 4.1 - same as Thales EMV2000
- 4.2 - same as Thales common session key derivation
- 4.3 - same as 4.2 in case of double length key (16 bytes) and algorithmBlockSize 8 bytes (DES key)
Thales - EMV mapping
Command code = KQ (EMV v.3), sceme ID = 0
Command code = KQ (EMV v.3), sceme ID = 1
Command code = KQ (EMV v.3), sceme ID = 2
Command code = KW (EMV v.4), sceme ID = 0
- emvVersion - 4.1
- type - a
- macAlgorithm
Command code = KW (EMV v.4), sceme ID = 1
- emvVersion - 4.1
- type - b
- macAlgorithm
Command code = KW (EMV v.4), sceme ID = 2
- emvVersion - 4.2 OR 4.3
- type - a
- macAlgorithm
Command code = KW (EMV v.4), sceme ID = 3
- emvVersion - v4.3
- type - b
- algorithmBlockSize - 8
- macAlgorithm = 3
TR31 key block decryption (keyblockDecrypt)
Supports only algorithm B as defined in Ref 8 section 5.3.2.1 of TR31 keyblock specifications.