Home > other >  NXP Mifare S70 EV1 7 bytes UID card now find card - 2 times put a collision can be the key validatio
NXP Mifare S70 EV1 7 bytes UID card now find card - 2 times put a collision can be the key validatio

Time:11-02

The following is a key validation code:
Status=Authentication (UID, 0, TYPEA_MODE);////verification 0 sector keyA

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* name: Authentication */
/* function: this function is to realize the process of password authentication */
/* input: UID: card serial number address */
/* SecNR: sector number */
/* mode: the mode */
/* output: FM1715_NOTAGERR: no card */
/* FM1715_PARITYERR: parity check wrong */
/* FM1715_CRCERR: CRC check wrong */
/* FM1715_OK: reply right */
/* FM1715_AUTHERR: authoritative attestation is wrong */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Uchar Authentication (uchar idata * UID, uchar SecNR, uchar mode)
{
Uchar idata I;
Uchar idata temp, temp1;

CRCPresetLSB=0 x63;
CRCPresetLSB=0 x63;
CWConductance=0 x3f;
ModConductance=0 x3f;
Temp1=Control;
Temp1=temp1 & amp; 0 xf7;
The Control=temp1;

If (mode==1)//AUTHENT1
Buffer [0]=RF_CMD_AUTH_LB;//61
The else
Buffer [0]=RF_CMD_AUTH_LA;//60
Buffer [1]=SecNR * 4 + 3;
for (i=0; i <4. I++)
{
Buffer [2 + I]=UID [I];
}
ChannelRedundancy=0 x0f;//open the CRC, parity check
Temp=Command_Send (6, buffer, Authent1);
If (temp==FALSE)
{
Return FM1715_NOTAGERR;
}
Temp=ErrorFlag;
If ((temp & amp; 0 x02)==0 x02)
Return FM1715_PARITYERR;
If ((temp & amp; 0 x04)==0 x04)
Return FM1715_FRAMINGERR;
If ((temp & amp; 0 x08)==0 x08)
Return FM1715_CRCERR;

Temp=Command_Send (0, buffer, Authent2);//AUTHENT2
If (temp==FALSE)
{
Return FM1715_NOTAGERR;
}
Temp=ErrorFlag;
If ((temp & amp; 0 x02)==0 x02)
Return FM1715_PARITYERR;
If ((temp & amp; 0 x04)==0 x04)
Return FM1715_FRAMINGERR;
If ((temp & amp; 0 x08)==0 x08)
Return FM1715_CRCERR;
Temp1=Control;
Temp1=temp1 & amp; 0 x08;//Crypto1on=1 validation by
If (temp1==0 x08)
{
Return FM1715_OK;
}
Return FM1715_AUTHERR;
}

At present is the key validation has been not line, I tried CL1 and CL2 4 bytes before the 4 bytes UID validation is not line, the great god can help me with?

CodePudding user response:

Do you want to make sure whether your card is factory Settings, if after is 4 bytes;
  • Related