Upload
hoangnhu
View
225
Download
2
Embed Size (px)
Citation preview
DESFire Demo & WorkshopDESFire Demo & Workshop
CAS - 2006
Semiconductors 2
• Demonstrate functionality DESFire commands• Source for evaluating the DESFire card• Demonstrate different data transfer rates
• Hardware requirements: - RD70x Pegoda reader- DESFire card
• Software Requirement:- DESFireUI
Introduction DESFireUI Demo Software
Semiconductors 3
DESFire UI Software Demo
Step 1: PC to Pegoda communication
Semiconductors 4
DESFire UI Software Demo
Step 2: Activate the T=CL
0 = 106 kbps1 = 212 kbps2 = 424 kbps3 = 848 kbps
Semiconductors 5
DESFire UI Software Demo
Step 3: Security & PICC command level
Semiconductors 6
• After power up, card selection and initialization, application DESFire AID=0x000000 is selected(Card level = “root-directory”)
• All keys are default at 0x0000000000000000
• File commands can be used if there is an existing file in the selected Application
• 3 types of files can be create (Data, Value and Records)
• Maximum number of file is 16
• FID can range from 0 to 15
• File with Backup mechanism must have FID range from 0 to 7
DESFire UI Software Demo
Step 3: Status of “new” DESFire card
Semiconductors 7
DESFire UI Software Demo
Step 4: Create an Application with AID=0x123456
Set the number of key used in this application to maximum (14 keys).
Set the condition for Application Master key
Set Application Master Key to be used when changing the Application Keys
Confirm command with button
Semiconductors 8
DESFire UI Software Demo
Step 5: Select Application AID=0x123456
Semiconductors 9
DESFire UI Software Demo
Step 6: Application command level
Semiconductors 10
DESFire UI Software Demo
Step 7: Create a Backup Data File with FID=0x02
Set the file communication encryption level to DES/3DES MACing
Setting the access conditions for the file (Key 1, 2 & 3 are being used for the different access)
Set the file size to 15 bytes (take note of the actual memory space used)
Create the file with Backup mechanism
Semiconductors 11
DESFire UI Software Demo
Step 8: Authenticate with key #2 before writing data in fileKey 2 of the Application AID=0x123456 have to be used for data file writing of FID=0x02
Default key is always 0x00
Semiconductors 12
DESFire UI Software Demo
Step 9: Write data into file FID=0x02
Set offset from the beginning of the file as 0
Enter data to be written in Hexadecimal
Since this is a Backup file, data written must be validated by the Commit Transaction command
Semiconductors 13
DESFire UI Software Demo
Step 10: Authenticate with key #1 before reading from file
Semiconductors 14
DESFire UI Software Demo
Step 11: Read data from file FID=0x02
Semiconductors 15
• Start DESFireUI• Open Interface
- check “Automatically retrieve command times”• T=CL Commands
- Activate Idle- RATS- skip PPS
• Security Commands- Authenticate PICC with key 0- Format PICC
• PICC commands- Create Application with AID: 0x123456 and 1 (one) key(Change key access rights = 14)
- Select Application with AID: 0x123456
DESFire UI Software Demo
Demonstrate DESFire data rates (1)
Semiconductors 16
• Application Commands- Create Data File with File ID 0x11; file size 3872 bytes(plain communication, all access rights 14, NO backup)
• Reset Total Time• File Commands
- Data File Access; Read Data(FileID 0x11, Offset = 0, Length = 0)
• Read Total Read Time in Total Time Windows• Repeat a few times for consistent timings
DESFire UI Software Demo
Demonstrate DESFire data rates (2)
Semiconductors 17
• T=CL Commands - Deselect - Change DSI to 2 and DRI to 2- Activate Wakeup- RATS- PPS
• PICC commands- Select Application with AID: 0x123456
• Reset Total Time• File Commands
- Data File Access; Read Data(FileID 0x11, Offset = 0, Length = 0)
• Read Total Read Time in Total Time Windows• Repeat a few times for consistent timings
DESFire UI Software Demo
Demonstrate DESFire data rates (3)
Coding forDSI & DRI:
0 = 106 kbps1 = 212 kbps2 = 424 kbps3 = 848 kbps
Semiconductors 18
• Create an Application with AID=0xABCDEF– Application should have 6 keys– Creation/deleting of file require application Master Key– Authenticate with key #1 is needed for changing any key
• Create a Data File with FID=0xE– Communication of file is Full DES/3DES enciphering– Set access condition as: Read & Write & Read/Write (Key #2), Change AC
(Key #1)– File size is 64 bytes
• Create a Cyclic Record File with FID=0x2– Communication of file is DES/3DES MACing– Set access condition as: Read (Key #3) & Write & Read/Write (Key #4),
Change AC (Key #1)– Record size is 16 bytes– Number of record is 3
DESFire UI Software Workshop
Requirement TrainingExercise
Semiconductors 19
• Create a Value File with FID=0x4– Communication of file is Full DES/3DES MACing– Set access condition as: Read (Key #3) & Write (Key #4), & Read/Write (Key
#5), Change AC (Key #1)– Set Upper Limit to 1000 and set Lower limit to 10– Set Initial value to 100 – Enable Limited Credit function
• Change the Application Keys as follow:– Key #1:- 0x000102030405060708090A0B0C0D0E0F– Key #2:- 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF– Key #3:- 0xFFFFFFFFFFFFFFFF0000000000000000
• Write any data into the Data files and Read it from the file to verify• Write 3 record with 16 bytes of data• Increase the Value File with 100 and then decrease it with 50
DESFire UI Software Workshop
Requirement TrainingExercise
Semiconductors 20
• Format DESFire card• Create an Application with AID=0x000001
– Application should have 14 keys– Check all boxes– Key #0 will be used to change access rights
• Create an Application with AID=0x000002 (same conditions)• Create an Application with AID=0x000003 (same conditions)• Get Application IDs • Select Application ID 0x000002• Create Data File with File ID 0x01
– Plain communication, use key 14 for all access rights– File size: 50 bytes; check Backup File box
• Create Value File with File ID 0x02– Plain communication, use key 14 for all access rights– Upper Limit: 500; Lower Limit: 50; Initial Value: 250; with limited Credit
• Create Record File with File ID 0x03– Plain communication, use key 14 for all access rights– Record size: 20 bytes; Number of records: 11; make it cyclic
DESFire UI Software Workshop
Exercise 1
Semiconductors 21
• Check File IDs • Check File Settings of file 0x02 • Write 0x00112233445566778899 to data file 0x01
– Offset 0; Commit Transaction; Read Data• Write 0xAABBCCDDEEFF to data file 0x01
– Offset 5; Commit Transaction;– Offset 0; Length: 20; Read Data
• Get Value of value file 0x02– Credit 100 and Get Value– Debit 50 and Get Value– Limited Credit 60 and notice error message– (Check File Settings of file 0x02)– Limited Credit 50 and Get Value
• Write 0x111111111111 to Record File 0x03 – Read record with start record: 0; number of records: 1; offset: 0– Write 0x222222222222– Write 0x333333333333– Read record with start record: 0; number of records: 1; offset: 0– Read record with start record: 1; number of records: 2; offset: 0
DESFire UI Software Workshop
Exercise 1 (continued)
Semiconductors 22
• Format DESFire card• Create an Application with AID=0xABCDEF
– Application should have 6 keys– Creation/deleting of file require application Master Key– Authenticate with key #1 is needed for changing any key
• Create a Data File with FID=14– Communication of file is Full DES/3DES enciphering– Set access condition as:
Read & Write & Read/Write (Key #2), Change AC (Key #1)– File size is 64 bytes
• Create a Cyclic Record File with FID=0x2– Communication of file is DES/3DES MACing– Set access condition as:
Read (Key #3) & Write & Read/Write (Key #4), Change AC (Key #1)– Record size is 16 bytes– Number of record is 3
DESFire UI Software Workshop
Advanced Exercise (1)
Semiconductors 23
• Create a Value File with FID=0x4– Communication of file is Full DES/3DES MACing– Set access condition as:
Read (Key #3) & Write (Key #4), & Read/Write (Key #5), Change AC (Key #1)– Set Upper Limit to 1000 and set Lower limit to 10– Set Initial value to 100 – Enable Limited Credit function
• Change the Application Keys as follow:– Key #1:- 0x000102030405060708090A0B0C0D0E0F– Key #2:- 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF– Key #3:- 0xFFFFFFFFFFFFFFFF0000000000000000
• Write any data into the Data files and Read it from the file to verify• Write 3 record with 16 bytes of data• Increase the Value File with 100 and then decrease it with 50
DESFire UI Software Workshop
Advanced Exercise (2)