Specifications
P25 Development Guide
www.bluebamboo.com
The format of the “DATA” is:
FIELD LEN
Byte
DESCRIPTION
Version 1 Specify the data encryption protocol version. It should be
0x02
Key ID (RFU) 1 Specify which key is used to encrypt data. P25 supports only
one key right now. Its value should be 0x00.
Alg ID 1 Specify the type of data encryption and key management
method
0x01 : Fixed DES
0x02 : Fixed 3DES
0x03 : Single DES DUKPT
0x04 : 3DES DUKPT
0x05-0xFF: RFU (Reserved for Future Use)
KSN (optional) 10 Key Serial Number, if DUKPT is applied
Encrypte
d Track1
Data
Length
1
Encrypte
d Track1
Data
Encrypte
d Track2
Data
Length
1
Encrypte
d Track2
Data
Encrypte
d Track3
Data
Length
1
Encrypted
Track
Data
Encrypte
d Track3
Data
The length should be 0 if there is no data in this track.
It is should be in multiple of cipher block size (8 bytes in this
case).
1. The data to be encrypted is the track data(s) in clear text.
2. The track data(s) should be padded to multiple of cipher
block size (8 bytes in this case).
3. The padding string is comprised of bytes equal to the
padding string length ( if data is already multiple of block
size, a new block with all bytes equal to block size needs
to be padded)
Eg.
The data to be encrypted in the example of above section is
45 bytes long (1 cmd+44 track data)
31 30 30 30 39 25 31 48 49 4A 4B 4C 4D 3F 32 30 30 30 39
3B 32 35 36 37 38 39 30 3F 33 30 30 31 31 3B 33 34 34 35
35 36 36 37 38 3F;
3 bytes need to be padded to make it 48 bytes long, the
padding bytes are all ‘03’:
31 30 30 30 39 25 31 48 49 4A 4B 4C 4D 3F 32 30 30 30 39
3B 32 35 36 37 38 39 30 3F 33 30 30 31 31 3B 33 34 34 35
35 36 36 37 38 3F 03 03 03.
If the MSR data is 48 bytes long which is multiple of 8
already, a new block with 8 ‘08’ should be padded:
31 30 30 30 39 25 31 48 49 4A 4B 4C 4D 3F 32 30 30 30 39
3B 32 35 36 37 38 39 30 3F 33 30 30 31 33 3B 33 34 34 35
35 36 36 37 38 39 39 39 39 3F 08 08 08 08 08 08 08 08
Card’s Last 4 Digits
(Optional)
4
Cardholder’s First and
Last name
(Optional)
26
Card Expiration Date
(Optional)
4