IT豆知識

IT関連技術レポートの情報公開(#4 How to find out HID Prox card Nunber)

作成者: Keith Nakagama|Jul 5, 2024 12:45:52 AM

HID Cardの番号の見つけ方

HID Cardの番号の見つけ方

How to find out HID Prox card Number

1.HID Prox | UID Length 26 Bits 

1.HID Prox | UID Length 26 Bits | UID HEX 029342E4

2.HID Prox | UID Length 26 Bits Detail

  • How to Create from Employee number to PSES Number.
    • HID Prox 26 bit Specification.

P is Parity.

           P S S S S S S S S N N N N N N N N N N N N N N N N   P

BIT       1 2                     9 10                                                         25 26

 

Rule;

BIT       1 is an even parity for the following 12 bits. The sum of bits 1-13 is even.

BITS     2-9 are the SITE CODE.

 

BITS    10-25 This is the number usually employee number.

BIT       26 is an odd parity over the previous 12 bits. The sum of bits 14-25 is odd.

14-25 sum is Odd which 26 bit is 0 and if Even, 26 bit is 1

To change employee number to HID number has two formula;

- (Employee number x 2)

- (Employee number x 2+1)

To check 14-25 sum is related.

 

Example 1: Site Code of 004 and a Card Number of 123 output will be  

1 0 0 0 0 0 1 0 0    0 0 0 0  0 0 0 0 0 1 1 1 1 0 1 1  1

 

Example 2: Site Code of 240 and a Card Number of 9501 output will be  

1 1 1 1 1 0 0 0 0    0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 1  1

 

Example 3: Site Code of 240 and a Card Number of 9500output will be  

1 1 1 1 1 0 0 0 0    0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 0  0

 

Max Site code is 255

Max card number is 16384

3. How to change from Decimal to Hex on the Excel

  • Formula
    • To change Employee number to Hex 

40225        -> 9D21

                 =DEC2HEX(B4)+1

 

  • Hex change to Bit

9D21          ->1001110100100001 =CONCATENATE(TEXT(HEX2BIN(MID(C4,2,1)),"0000")&TEXT(HEX2BIN(RIGHT(C4,2)),"00000000"))

- Hex2Bin function can use only 2 digit Hex number.

- Binary should not eliminate top 0 data to control digit.

- To use 14-25 bit that means we need D21 but not 9D21.

 

  • To count “1”

110100100001 -> 5

=LEN(D4)-LEN(SUBSTITUTE(D4,"1",""))

To change ‘1’ to blank and calculate character length.

Original length minus calculated length is number of ‘1’.

Odd means no need 1 on the 26 bit. 26bit is ‘0’.

Even means need 1 on the 26 bit. 26bit is ‘1’.

 

  • To select 26 bit(Parity bit)

MOD(N156,2)=0   -> DEC2HEX(F156*2+1)

MOD(N156,2)=1   -> DEC2HEX(F156*2+0)

 

  • Add redundancy

1A029+ calculated employ number +FFFFFFFFFFFFFFFFFFFFFF

1A029+33A7D+FFFFFFFFFFFFFFFFFFFFFF

 

=CONCATENATE($K$156,DEC2HEX(F156*2+1+HEX2DEC(20000)),$L$156),CONCATENATE($K$156,DEC2HEX(F156*2+0+HEX2DEC(20000)),$L$156))

 

  • Final formula

=IF(MOD(N156,2)=0,CONCATENATE($K$156,DEC2HEX(F156*2+1+HEX2DEC(20000)),$L$156),CONCATENATE($K$156,DEC2HEX(F156*2+0+HEX2DEC(20000)),$L$156))