MAC Calculation in AN12196 seems faulty?

cancel
Showing results for 
Search instead for 
Did you mean: 

MAC Calculation in AN12196 seems faulty?

75 Views
Contributor I

I am trying to calculate the example in AN12196 on page 44, Table 28, step 14

Bildschirmfoto 2020-05-11 um 19.40.26.png

I get decrypt the data to get the UID as stated in step 19 but I cannot calculate the same MAC.

My result (using the example data from the AN12196:

sesAuthMac: 379d32130ce61705dd5fd8c36b95d764

sesAuthEnc: 2b4d963c014dc36f24f69a50a394f875

response data from apdu: 70756055688505b52a5e26e59e329cd6595f672298ea41b7

ti: df055522

cmd: 51

cmdctr: 0100

status: 70

rep_data: 756055688505b52a5e26e59e329cd6

mact_received: 595f672298ea41b7

input_ivr: 5aa5df05552201000000000000000000

IVR: 7f6bb0b278ea054cbd238c5d9e9e342b

input_mac (status + cmdctr + ti + status + rep_data): 700100df05552270756055688505b52a5e26e59e329cd6

DIFFRENT: mac: 432c354cb24d2b359c76bb501674ea65

input_dec_rep: 70756055688505b52a5e26e59e329cd6

dec_rep: 04958caa5c5e80800000000000000000

DIFFERENT: mact_calculated: 2c4c4d3576507465

Is there something wrong in the AN? Could you help me to solve it? Thank you very much in advance.

Tags (3)
0 Kudos
1 Reply

4 Views
NXP TechSupport
NXP TechSupport

Hi Ibrahim Atli,

Please check the following process I did on an NTAG I have and a Pegoda reader :

I activate the card, send select command, authenticate to key 00 then send the GetCardUID command.

phpalI14443p3a_ActivateCard--------ENTRY--------  
phpalI14443p3a_ActivateCard--------LEAVE-------- pUidOut=044D0F2AAA6180   pSak=20   pMoreCardsAvailable=00   [STATUS = SUCCESS]


phpalI14443p4a_ActivateCard--------ENTRY-------- bFsdi=08   bCid=00   bDri=00   bDsi=00  
Send to card: E080
Recv from card: 067777710280
phpalI14443p4a_ActivateCard--------LEAVE-------- pAts=067777710280   [STATUS = SUCCESS]


phalMfNtag42XDna_IsoSelectFile--------ENTRY-------- bOption=0C   bSelector=04   pFid=10E1   pFid=10E1   bDFnameLen=07   pDFname=D2760000850101  

phpalI14443p4_Exchange--------ENTRY-------- wOption=8000   pTxBuffer=00A4040C07
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]


phpalI14443p4_Exchange--------ENTRY-------- wOption=C000   pTxBuffer=D2760000850101
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]

Send to card: 00A4040C07D276000085010100

phpalI14443p4_Exchange--------ENTRY-------- wOption=4000   pTxBuffer=00
phpalI14443p4_Exchange--------LEAVE-------- ppRxBuffer=9000   [STATUS = SUCCESS]

Recv from card: 9000
phalMfNtag42XDna_IsoSelectFile--------LEAVE-------- [STATUS = SUCCESS]


phKeyStore_FormatKeyEntry--------ENTRY-------- wKeyNo=0000   wNewKeyType=0000
phKeyStore_FormatKeyEntry--------LEAVE-------- [STATUS = SUCCESS]


phalMfNtag42XDna_AuthenticatEv2--------ENTRY-------- bAuthOption=01   wOption=FFFF   wKeyNo=0000   wKeyVer=0000   bKeyNoCard=00      

phpalI14443p4_Exchange--------ENTRY-------- wOption=8000   pTxBuffer=9071000002
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]


phpalI14443p4_Exchange--------ENTRY-------- wOption=C000   pTxBuffer=0000
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]

Send to card: 9071000002000000

phpalI14443p4_Exchange--------ENTRY-------- wOption=4000   pTxBuffer=00
phpalI14443p4_Exchange--------LEAVE-------- ppRxBuffer=F48D371304FA1DAE48542F98B49DE00791AF   [STATUS = SUCCESS]

Recv from card: F48D371304FA1DAE48542F98B49DE00791AF

phpalI14443p4_Exchange--------ENTRY-------- wOption=8000   pTxBuffer=90AF000020
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]


phpalI14443p4_Exchange--------ENTRY-------- wOption=C000   pTxBuffer=A1107BFBFE5F645B5D9436BE993CF34B031445CAC0458EA64ADE1F2DD52ACC94
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]

Send to card: 90AF000020A1107BFBFE5F645B5D9436BE993CF34B031445CAC0458EA64ADE1F2DD52ACC9400

phpalI14443p4_Exchange--------ENTRY-------- wOption=4000   pTxBuffer=00
phpalI14443p4_Exchange--------LEAVE-------- ppRxBuffer=3C615E81956DC9ED2F25AE4A7412A9403692508B047CBA952A0972F2DE5150789100   [STATUS = SUCCESS]

Recv from card: 3C615E81956DC9ED2F25AE4A7412A9403692508B047CBA952A0972F2DE5150789100
phalMfNtag42XDna_AuthenticatEv2--------LEAVE-------- bPcdCapsOut=000000000000   bPdCapsOut=000000000000   [STATUS = SUCCESS] AUTHENTICATED 


phalMfNtag42XDna_GetCardUID--------ENTRY--------

phpalI14443p4_Exchange--------ENTRY-------- wOption=8000   pTxBuffer=9051000008
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]


phpalI14443p4_Exchange--------ENTRY-------- wOption=C000   pTxBuffer=F24CAEC10282C6B2
phpalI14443p4_Exchange--------LEAVE-------- [STATUS = SUCCESS]

Send to card: 9051000008F24CAEC10282C6B200

phpalI14443p4_Exchange--------ENTRY-------- wOption=4000   pTxBuffer=00
phpalI14443p4_Exchange--------LEAVE-------- ppRxBuffer=714B670CA2E09C231308AE2CE5DA57054C30CA74093D3F859100   [STATUS = SUCCESS]

Recv from card: 714B670CA2E09C231308AE2CE5DA57054C30CA74093D3F859100
phalMfNtag42XDna_GetCardUID--------LEAVE-------- pUid=044D0F2AAA6180   bCardUidLength=07   [STATUS = SUCCESS]

Have a great day !

BR

Jonathan

0 Kudos