MagTek MagneSafe V5 User Manual

Page 113

Advertising
background image

Appendix D. Command Examples

105

Example 9: Configuring a reader after encryption is enabled (Security Level 3 or 4). In this example the
reader is in Keyboard Mode:

; This script demonstrates configuration commands for KB mode.
; It assumes the reader is at Security Level 3 or 4 and that the KSN counter
; is at 0x10.
09 00 ; Get current KSN (should be FFFF9876543210E00010)
Request : CMND=09, LEN=00, DATA=
Response : RC= 00, LEN=0A, DATA=FF FF 98 76 54 32 10 E0 00 10

; For this KSN counter the MAC Key is: 59598DCBD9BD6BC0 94165CE45358A057
00 01 02 ; Get current Polling Interval
Request : CMND=00, LEN=01, DATA=02
Response : RC= 00, LEN=01, DATA=01

; Form MAC for Set Property command
; Message to be sent is: 01 06 02 01 nnnnnnnn (nnnnnnnn is the MAC)
; Message to be MACd is: 0106020100000000
; This is the simplest MAC, simply TDES encrypt the message to be MACd with
; the MAC Key:
; 0106020100000000 MACd with 59598DCBD9BD6BC0 94165CE45358A057
; gets 8720CE23310961B5
; MAC is first four bytes: 8720CE23
01 06 02 01 8720CE23 ; Set Polling Interval to 1 ms
Request : CMND=01, LEN=06, DATA=02 01 87 20 CE 23
Response : RC= 00, LEN=00, DATA=

00 01 1E ; Get current Pre Card String
Request : CMND=00, LEN=01, DATA=1E
Response : RC= 00, LEN=00, DATA=

; Form MAC for Set Property command
; Message to be sent is: 01 05 1E nnnnnnnn (nnnnnnnn is the MAC)
; Message to be MACd is: 01051E0000000000
; This is the simplest MAC, simply TDES encrypt the message to be MACd with
; the MAC Key:
; 01051E0000000000 MACd with 59598DCBD9BD6BC0 94165CE45358A057
; gets 5157FCBC179B0B95
; MAC is first four bytes: 5157FCBC
01 05 1E 5157FCBC ; Set to ""
Request : CMND=01, LEN=05, DATA=1E 51 57 FC BC
Response : RC= 00, LEN=00, DATA=

00 01 1F ; Get current Post Card String
Request : CMND=00, LEN=01, DATA=1F
Response : RC= 00, LEN=00, DATA=

; Form MAC for Set Property command
; Message to be sent is: 01 05 1F nnnnnnnn (nnnnnnnn is the MAC)
; Message to be MACd is: 01051F0000000000
; This is the simplest MAC, simply TDES encrypt the message to be MACd with
; the MAC Key:
; 01051F0000000000 MACd with 2B5F01F4F0CCFAEA 639D523231BFE4A2
; gets 4885838CCC672376
; MAC is first four bytes: 4885838C
01 05 1F 4885838C ; Set to ""
Request : CMND=01, LEN=05, DATA=1F 48 85 83 8C Response : RC= 00, LEN=00,
DATA=
Response : RC= 00, LEN=00, DATA=

Advertising