Site Tools


desfire

DESFire User Manual

Overview

MIFARE DESFire EV1 card operates at 13.56 MHz wireless frequency, according to the ISO 14443A standard with the transport protocol complying to the ISO 14443-4 standard. It features a 4K byte NVM, a high speed triple-DES data encryption co-processor, a flexible memory organization structure, a mutual 3-pass authentication technique together with a true random number generator and an anti-tear mechanism to guarantee data integrity during contactless transactions. It can be applied to multiple applications that needed high security, such as, entrance guard system, staff attendance, company access, identification and so on.

Preparation

Hardware:

Software:

Note: Please download pyResMan from javacardos.com or gitHub.

User Guide

Connect R502 Reader to computer via USB cable and put DESFire Card on R502 Reader. Double click pyResMan.exe. Select contactless mode reader from the ReaderName dropdown list and click “Connect” button to connect the smart card reader. Then switch to “DESFire” tab.

1.1 Authenticate

Click “Authenticate” to complete the card authentication. When “DESFire authenticated” appears, it indicates that the authentication is successful. This procedure not only confirms that both entities can trust each other but also generates a session key which can be used to keep the further communication path secure. After the authentication procedure is successfully, the further operation on PICC, application, file, file data can be executed.

1.2 ChangeKey

Not implemented yet.

1.3 GetKeySettings

Click “Get key settings” button to get the configuration information on PICC and application master key configuration settings, as shown below.

2.PICC Level Commands

2.1 GetVersion

Click “GetVersion” to get manufacturing related data of the PICC.

2.2 FormatPICC

Click “FormatPICC” to release the PICC user memory.

Note: This operation requires a preceding authentication with the PICC master key, otherwise it will return the error code.

2.3 CreateApplication

Click “Create Application” to create new applications on the PICC. Type Application Identifier (AID) and then press “OK”.

Note: AID must be an unique identification, and it cannot be repeated.

2.4 GetAppliationIDS

The “Get Application IDS” command returns the Application IDentifiers of all active applications on a PICC and add them to the right dropdown list.

2.5 SelectApplication

“SelectApplication” command allows to select one specific application for further access.

2.6 DeleteApplication

Click “DeleteApplication” button to permanently deactivate the selected applications on the PICC.

3.Application and Data Manipulation Level Commands

3.1 Create Std Data File

Click “Create Std Data File” to create files for the storage of plain unformatted user data within the currently selected application on the PICC. In the pop-up dialog box, enter File No. and set the file size, press “OK”.

File No.: File Identifier is non-repeatable, otherwise the error code will be returned.

File Size: The size of the file in bytes.

3.2 Create Backup Data File

Click “Create Backup Data File…” to create backup files for the storage of plain unformatted user data within the currently selected application on the PICC. In the pop-up dialog box, enter File No. and set the file size, press “OK”.

File No.: File Identifier is non-repeatable, otherwise the error code will be returned.

File Size: The size of the file in bytes.

3.3 CreateValueFile

Click “Create Value File…” to create files for the storage and manipulation of 32bit signed integer values within an existing application on the PICC. In the pop-up dialog box, enter “File No.”, set “Upper Limit” and “Value”.

3.4 CreateLinearRecordFile

Click “Create Linear RecordFile…” in the pop-up dialog box, enter “File No.” and set “Record Size” to to create Linear Record File. Once the file is filled completely with data records and the maximum number of records. further writing to the file is not possible unless it is cleared.

File No.: File Identifier is non-repeatable, otherwise the error code will be returned.

Record Size: The size of the file to record.

Max Num. of records: The maximum number of records in bytes.

3.5 Create Cyclic Record File

Click “Create Cyclic Record File…” to create files within the currently selected application on the PICC. In the pop-up dialog box, enter File No. and set the size of the file to record and the maximum number of records. Once the file is filled completely with data records, the PICC automatically overwrites the oldest record with the latest written one.

Note: Parameters with the create LinearRecordFile consistent.

3.6 Get File IDs

Click “Get File IDs” button to get File IDentifiers of all active files within the currently selected application and add them to the right dropdown list.

3.7 Get File Settings

Click “Get File Settings” to get information on the properties of a specific file.

3.8 Changes Files Settings

Not implemented yet.

3.9 Delete File

Click “Delete File” to permanently delete a file within the file directory of the currently selected application.

4.Data Manipulation Commands

4.1 Write Record

In the dropdown list, select the created standard data files or backup data files, click “Write Data…” and enter the data in the pop-up dialog box.

4.2 Read Data

In the dropdown list, select the standard data files or backup data files, click “Read Data…” and enter the length of data to read in the pop-up dialog box, press “OK”.

4.3 Credit

In the dropdown list, select the created value file, then the buttons of “value File” line and “Transaction” line are avaliable.

Click “Credit…”, enter data in the “value” textbox and press “OK”.

4.4 Get Value

From the list box, select the created value file, click “Get Value…” to read data.

4.5 Debit

From the list box, select the created value file, click “Debit” to decrease a value stored in a Value File.

The step must click “Commit Transaction” to commit transaction. Click “Get Value” to verify the previous operation.

4.6 LimitedCredit

Click “Limited Credit” button, enter data in “value” textbox and press “OK”.

4.7 Write Record

Select the created “linear Record File” or “cyclic record file” in the list. then the buttons of “Record File” line are available.

Click “Write Record” and enter Data in the pop-up dialog box, press “OK”.

4.8 Read Records

Click “Read Records…” and enter the length of data to read in the pop-up dialog box, press “OK”.

4.9 Clear Record File

Click “Clear Record File…” to clear LinearRecordFile data or CyclicRecordFile data,then remember to click “Commit Transaction” to validate the data.

At this time, if you read data and it doesn't return any information, it indicates this command is executed successfully.

4.10 Commit Transaction

Besides std data file, for other files, it requires “Commit Transaction” operation to validate the data. Otherwise, the data won't have any changes.

Note: You can use “GetValue” to verify the validity of the data.

4.11 Abort Transaction

The AbortTransaction command allows to invalidate all previous write access on Backup Data Files, Value Files and Record Files within one application. This is useful to cancel a transaction without the need for re-authentication to the PICC, which would lead to the same functionality.

desfire.txt · Last modified: 2017/05/16 07:17 by JavaCardOS