Forum › MIFARE SmartCard IC`s › MIFARE DESFire › I have problem in AUTHENTICATION › Re: I have problem in AUTHENTICATION
hi again
Sorry for my English.
My current key is uint8_t key = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
when i change uint8_t key = {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0};
AUTHENTICATION worked with no error.
when uint8_t key = {0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0};
AUTHENTICATION not worked
I have one other question .
How can I change key :-)
1 : first AUTHENTICATION with old key
2 : xor Old key and new key. [16 byte with 16 byte]
3 : calc crc16 . [ 2 byte ]
4 : set to zero next 6 byte buffer.
5 : Decrypt 24 byte with old key.
6 : add 0xc4 and 0x00 to first of block and send data
but not work.
my crc16 function is
uint16_t crc16(uint8_t * data_p, uint8_t length)
{
uint8_t x;
uint16_t crc = 0xFFFF;
while (length--){
x = crc >> 8 ^ *data_p++;
x ^= x>>4;
crc = (crc << 8) ^ ((unsigned short)(x << 12)) ^ ((unsigned short)(x <<5)) ^ ((unsigned short)x);
}
return crc;
}
thanks for your answer
Sorry for my English.
My current key is uint8_t key = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
when i change uint8_t key = {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0};
AUTHENTICATION worked with no error.
when uint8_t key = {0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0};
AUTHENTICATION not worked
I have one other question .
How can I change key :-)
1 : first AUTHENTICATION with old key
2 : xor Old key and new key. [16 byte with 16 byte]
3 : calc crc16 . [ 2 byte ]
4 : set to zero next 6 byte buffer.
5 : Decrypt 24 byte with old key.
6 : add 0xc4 and 0x00 to first of block and send data
but not work.
my crc16 function is
uint16_t crc16(uint8_t * data_p, uint8_t length)
{
uint8_t x;
uint16_t crc = 0xFFFF;
while (length--){
x = crc >> 8 ^ *data_p++;
x ^= x>>4;
crc = (crc << 8) ^ ((unsigned short)(x << 12)) ^ ((unsigned short)(x <<5)) ^ ((unsigned short)x);
}
return crc;
}
thanks for your answer
+ 0
|
- 0