For example, the encryption of P is
40700F
encrypt  mask             parity

40700F & 000003 = 000003  0
40700F & 041001 = 041001  1 X!
40700F & 00C000 = 004000  1
40700F & 006000 = 006000  0
40700F & 003000 = 003000  0
40700F & 001000 = 001000  1

Scan code 011001 corresponds to P.  Check!

bit of scancode     parity mask
5                   0x000003
4                   0x041001
3                   0x00C000
2                   0x006000
1                   0x003000
0                   0x001000

 
