Samcrypto Functions: Manual
Samcrypto Functions: Manual
SAMCrypto Functions
Desktop Reader:
ID CPR40.30-SUSB
Reader Module:
ID CPR44.01-4SCUSB
ID CPR44.02-4SCUSB
Supported Transponder
mifare DESFire
final
confidential
2011-04-06
H01111-0e-ID-B.doc
OBID® classic-pro Manual SAMCrypto Functions
Note
Copyright 2011 by
FEIG ELECTRONIC GmbH
Lange Strasse 4
D-35781 Weilburg-Waldhausen (Germany)
Tel.: +49 6471 3109-0
http://www.feig.de
With the edition of this manual, all previous editions become void. Indications made in this manual may be changed with-
out previous notice.
Copying of this document, and giving it to others and the use or communication of the contents thereof are forbidden with-
out express authority. Offenders are liable to the payment of damages. All rights are reserved in the event of the grant of a
patent or the registration of a utility model or design.
Composition of the information in this manual has been done to the best of our knowledge. FEIG ELECTRONIC GmbH
does not guarantee the correctness and completeness of the details given in this manual and may not be held liable for
damages ensuing from incorrect or incomplete information. Since, despite all our efforts, errors may not be completely
avoided, we are always grateful for your useful tips.
The installation instructions given in this manual are based on advantageous boundary conditions. FEIG ELECTRONIC
GmbH does not give any guarantee promise for perfect function in cross environments.
FEIG ELECTRONIC GmbH assumes no responsibility for the use of any information contained in this manual and makes
no representation that they free of patent infringement. FEIG ELECTRONIC GmbH does not convey any license under its
patent rights nor the rights of others.
® ®
OBID and OBID i-scan is a registered trademark of FEIG ELECTRONIC GmbH.
®
mifare is a registered trademark of NXP Electronics N.V.
All cited brand names, product names, or trademarks belong to their respective holders.
If bits within one byte are filled with "-", these bit spaces are reserved for future extensions or for internal
testing- and manufacturing-functions. These bit spaces must not be changed, as this may cause faulty op-
eration of the Reader.
Content
1. Introduction 7
Revision Description
Described Firmware: 02.00.00
0 First edition
1. Introduction
®
This manual is a supplement document for OBID classic-pro ID CPR40.xx-xx and ID CPR44.0x-xx
reader family and describes the functionality of SAMCrypto functions which simplifies the data ex-
change of encrypted data with NXPs mifare DESFire transponder in connection with mifare SAM.
The SAMCrypto functions supporting SAM based authentication, ciphering and deciphering and se-
curity functions of mifare DESFire. The advantage of SAMCrypto firmware is the firmware internally
processing and handling of crypto functions between mifare DESFire and mifare SAM.
NOTICE:
This manual doesn't and cannot explain the functionality of mifare DESFire or mifare SAM.
For a better understanding of this manual the documentation from NXP has to be present to
get background knowledge.
In the following chapters the Host commands for communication with a DESFire Transponder are
described. Most of the commands have the same structure. Only the content of REQUEST-DATA
can vary depending on DESFIRE-COMMAND.
NOTICE:
The commands for DESFire communication can be performed only if the DESFire Trans-
ponder is selected by the standard ISO Host Command [0x25] Select .
Host Reader
1 2 3 4 5
DESFire-
n COM-ADR [0xC3] MODE
COMMAND
Host Reader
Depending on the DESFIRE-COMMAND and the success of the command the structure of
the reader response can vary:
STATUS = 0x00 - successful operation
1 2 3 4 (5...n-2) n-1, n
n COM-ADR [0xC3] STATUS (RESPONSE-DATA) CRC16
DESFIRE-COMMAND
This Sub-Command specifics the operation which shall be performed by the reader for data
exchange.
The command bytes are in most cases similar to the original DESFire commands.
MODE:
Bit: 7 6 5 4 3 2 1 0
Function 0 0 0 0 0 0 0 SAM
SAM:
b1: SAM is used for Encryption/Decryption
SLOT:
This parameter specifies the Slot Number where the SAM is connected.
TIMEOUT:
This parameter specifies a global timeout in steps of 100 ms. This value must be less
than the Host Interface Timeout.
REQUEST-DATA
The content of the REQUEST-DATA field may vary depending on the DESFIRE-
COMMAND and is described for each DESFIRE-COMMAND separate.
The following fields are part of REQUEST-DATA of many commands and are not separate
described for each command.
AID
3 byte DESFire Application ID.
DESFire KEY-NO (0x0...0xE)
Defines the number of the key to which the authentication shall be processed on
the DESFire to get access to the data. The KEY-No on DESFire is specified in the
access rights for each file.
0x0....0xD:
DESFire Key no for enciphered access
If a data exchange with a enciphered or MACed file shall be processed
the respective KEY-NO has to used here
0xE:
DESFire Key No for free access.
This setting is possible for "read", "write" and "read&write" access rights
for each file on the card. If this setting is used for "read&write" access
rights a different key setting for "read" access rights or "write" access
rights becomes obsolete.
NOTICE:
Depending on the DESFire KEY-NO and FILE-COMM-SETTINGS different se-
curity conditions can be configured. The following table shows the possible
combinations and how the security functions are influenced by this settings.
FILE-NO:
No of the file which should be read, written or otherwise manipulated.
ISO7816 FILE ID
ISO File IDs are used for ISO/IEC 7816-4 file systems. The ISOFile ID will be used
to select the application with the ISO SELECT command, file option. The parame-
ter is optional.
FILE-COMM-SETTINGS
coding of the communication mode of the dedicated file.
0x00: plain communication
0x01: plain communication secured by MACing
0x03: fully enciphered communication
RESPONSE-DATA
The content and length of RESPONSE-DATA are varying depending on the DESFIRE-
COMMAND.
In case of read commands from ciphered files the response data are deciphered data with-
out padding bytes or CRC.
In case of MACed data the MAC is checked by the firmware. The response data doesn't in-
clude the MAC value.
ERROR-SOURCE
This byte displays the reason where a error occurred while command processing
1: Transponder:
The recognized error occurred while transponder communication.
2: SAM:
The recognized error occurred while SAM communication. The ERROR-CODE is
generated by the SAM.
ERROR-CODE:
see ANNEX A1: Crypto Processing Error, of respective reader manual.
DESFire KEY-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
KeyDiv:
b0: no key diversification
b1: key diversified with 8 or 16 bytes SAM DIVINPUT
KeySel:
b0: key selection by key entry number
b1: key selection by DESFire key number
EncRnds:
b0: diversifying using two encryption rounds [only 3DES Key]
b1: diversifying using one encryption round [only 3DES Key]
b0: RFU (reserved for future use) for 3keyTDES Key or AES Key.
SAM KEY NO
SAM_SelectApplication sent before:
DESFire key number (0x00…0x0D)
No SAM_SelectApplication sent before:
key reference number of key entry (0x00…0x7F)
SAM DIVINPUT
8 (3DES) or 16 (AES) bytes diversification input.
The DESFire Change Key Settings command changes the master key configuration settings de-
pending on the addressed AID. Depending on the used parameters the reader performs ciphering,
padding and all further calculations which are necessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1)
NEW KEY
SETTINGS
NEW-KEY-SETTINGS
This parameter contains the new key settings of the via AID addressed application.
Depending on the selected AID the PICC master key setting or the application master key
settings can be changed.
AID = 0 The PICC Masterkey can changed.
AID > 0 The address application master key settings can changed.
This command can be used to get configuration information about the PICC and Application Master
Key Settings. In addition the maximum number of keys which can be stored within the selected ap-
plication is returned.
Host Reader
REQUEST-DATA
NO REQUEST-DATA NECESSARY
The DESFire Change Key command allows to change any key stored on the DESFire. Depending
on the used parameters the reader performs the authentication, ciphering, padding and all further
calculations which are necessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (1) (1) (1) (1) (8/16)
SAM KEY
SAM KEY SAM KEY NO SAM KEY SAM KEY SAM
VERSION SAM
COMP SAM CFG CURRENT NO NEW VERSION DIVINPUT
CURRENT DIVINPUT
METHOD KEY KEY NEW KEY LEN
KEY
SAM CFG
Bit: 7 6 5 4 3 2 1 0
Function - - - CMK KEY-NO-TB-CHANGED
CMK: b0: any other key, but not the DESFire8 card master key
shall be changed.
b1: the DESFire8 card master key shall be changed
KEY-NO-TB-CHANGED: Number of DESFire key to be changed
SAM DIVINPUT
8 (3DES) or 16 (AES) bytes diversification input.
Bit: 7 6 5 4 3 2 1 0
Function - - - - - - ISO7816 ISO7816
DF NAME FILE ID
KEY SETTINGS 1
Application Master Key Settings
Bit: 7 6 5 4 3 2 1 0
Function CHANGE KEY ACCESS RIGHTS CFG FREE FREE PMK
CHANGE CREATE_ DIRECTO CHANGE
ABLE DELETE RY ABLE
ACCESS
Bit 3 Bit 0
CFG CHANGEABLE:
b0: configuration not changeable anymore (frozen)
b1: this configuration is changeable if authenticated with the PICC master key
(default setting)
FREE CREATE_DELETE:
b0: Create Application / Delete Application is permitted only with PICC master
key authentication.
b1: Create Application is permitted without PICC master key authentication.
Delete Application requires an authentication with PICC master key or ap-
plication master key. (default setting)
FREE DIRECTORY ACCESS:
b0: Successful PICC master key authentication is required for executing the
GetApplicationIDs and KetKeySettings commands.
b1: GetApplicationIDs, GetDFNames and GetKeySettings commands suc-
ceed independently of a preceding PICC master key authentication. (de-
fault setting)
PMK CHANGEABLE:
b0: PICC Master Key is not changeable anymore (frozen).
b1: PICC Master Key is changeable (authentication with the current PICC
master key necessary) default setting)
KEY SETTINGS 2
Bit: 7 6 5 4 3 2 1 0
Function CRYPT ISO7816 - NO OF KEYS
CRYPT:
b00: specifies DES and 3DES operation for the whole application
b01: specifies 3K3DES operation for the whole application
b10: specifies AES operation for the whole application
ISO7816:
b00: NO 2 Byte File Identifiers for files within the application supported
b01: 2 Byte File Identifiers for files within the application supported
NO OF KEYS:
Number of keys that can be stored within the application for cryptographic purpos-
es. A maximum of 14 keys can be stored within an application of DESFire.
ISO7816 FILE ID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
ISO7816 DF NAME LEN
Length of the ISO7816 DF NAME (0.00…0x10). The parameter is optional.
ISO7816 DF NAME
DF-name is used in ISO7816 mode in combination with the ISO SELECT command. The
parameter is optional.
This command returns the Application Identifiers of all active applications on the DESFire PICC.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
This command returns the ISO/IEC 7816-4 DF-Names of all active applications on the DESFire
PICC.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
This command allows to select one specific application for further access.
Host Reader
REQUEST-DATA
(1) (3)
PICC LEVEL
AID
FLAGS
LSB MSB
AID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
This command can be used to release the user memory of the DESFire PICC.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
This command can be used to get the manufacturing related data of the DESFire PICC.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
This command can be used to get the free memory in bytes of the DESFire PICC.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
Master Key authentication on card level needs to be performed prior to the command. This com-
mand can be used to set the configuration of the DESFire PICC.
Host Reader
REQUEST-DATA
(1) (1)
PICC LEVEL OPTION
FLAGS
(1)
OPTION: 0x00
CONFIG
0x02 (5…20)
USER DEFINED ATS
CONFIG
Bit: 7 6 5 4 3 2 1 0
Function - - - - - - RANDOM FORMAT
ID CARD
RANDOM ID:
0: Format Card enabled
1: Format Card disabled (cannot be reset)
FORMAT CARD:
0: Random UID disabled
1: Random UID enabled (cannot be reset)
DEFAULT KEY
Default key, if shorter than 24 bytes only the left most bytes will be used.
This command is only applicable if the DESFire PICC uses random UIDS.
An authentication with any key needs to be performed prior to the command. This command returns
the UID and gives the opportunity to retrieve the UID, even if the random ID is used.
Host Reader
REQUEST-DATA
(1)
PICC LEVEL
FLAGS
Bit: 7 6 5 4 3 2 1 0
Function - - - - - - CHANGE ISO 7816
ACCESS FILE ID
RIGHTS
KEY
This command returns the File Identifiers of all active files within the currently selected application.
Host Reader
REQUEST-DATA
(1)
APPLICATION
LEVEL FLAGS
This command returns the 2 byte ISO/IEC 7816-4 File Identifiers of all active files within the current-
ly selected application.
Host Reader
REQUEST-DATA
(1)
APPLICATION
LEVEL FLAGS
This command allows to get information on the properties of a specific file. The information provided
by this command depends on the type of the file which is queried.
Host Reader
REQUEST-DATA
(1) (1)
APPLICATION FILE NO
LEVEL FLAGS
FILE NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
The DESFire Change File Settings command changes the access rights to an existing file. Depend-
ing on the used parameters the reader performs the ciphering, padding and all further calculations
which are necessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (2)
NEW- NEW-FILE-
APPLICATION
FILE-NO FILE-COMM- ACCESS-
LEVEL FLAGS
SETTINGS RIGHTS
LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
NEW-FILE-COMM-SETTINGS
New coding of the communication mode of the dedicated file
0x00: plain communication
0x01: plain communication secured by MACing
0x03: Fully enciphered communication
NEW-FILE-ACCESS-RIGHTS
Byte (1) (1)
Bit: 7...........................4 3...........................0 7...........................4 3...........................0
KEY-NO Read&Write Access Change Access Read Access Write Access
Rights Rights Rights Rights
KEY-NO (0x0...0xF)
Assigns the key with which an access to the dedicated operation shall permitted.
0x0....0xD:
Key no which shall used for authentication to get the respective access.
0xE free access (no authentication is necessary to get access)
0xF: deny access (the access in denied)
This command is used to create files for the storage of plain unformatted user data within an exist-
ing application on the PICC.
Host Reader
REQUEST-DATA
(1) (1) (2) (1) (2) (3)
FILE- FILE-
APPLICATION ISO7816
FILE-NO COMM- ACCESS- FILE SIZE
LEVEL FLAGS FILE ID
SETTINGS RIGHTS
[optional] LSB MSB LSB MSB
FILE-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
ISO7816 FILE ID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-ACCESS-RIGHTS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE SIZE
This parameter specifies the size of the file in bytes.
This command is used to create files for the storage of plain unformatted user data within an exist-
ing application on the PICC, additionally supporting the feature of an integrated backup mechanism.
Host Reader
REQUEST-DATA
(1) (1) (2) (1) (2) (3)
FILE- FILE-
APPLICATION ISO7816
FILE-NO COMM- ACCESS- FILE SIZE
LEVEL FLAGS FILE ID
SETTINGS RIGHTS
[optional] LSB MSB LSB MSB
FILE-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
ISO7816 FILE ID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-ACCESS-RIGHTS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE SIZE
This parameter specifies the size of the file in bytes.
This command is used to create files for the storage and manipulation of 32bit signed integer values
within an existing application on the PICC.
Host Reader
REQUEST-DATA
(1) (1) (1) (2) (4) (4) (4) (1)
FILE- FILE- LIMITED
APPLICATION LOWER UPPER
FILE-NO COMM- ACCESS- VALUE CREDIT
LEVEL FLAGS LIMIT LIMIT
SETTINGS RIGHTS ENABLED
LSB MSB LSB MSB LSB MSB LSB MSB
FILE-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-ACCESS-RIGHTS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
LOWER LIMIT
The lower limit marks the boundary which must not be passed by a Debit calculation on the
current value. The LOWER LIMIT is a 4 byte signed integer and thus may be negative too.
UPPER LIMIT
The lower limit marks the boundary which must not be passed by a Credit calculation on the
current value. The UPPER LIMIT is a 4 byte signed integer and thus may be negative too.
VALUE
VALUE is a 4 byte signed integer and specifies the initial value.
This command is used to create files for multiple storage of structural data, for example for loyality
programs, within an existing application on the PICC. Once the file is filled completely with data
records,further writing to the file is not possible unless it is cleared, see “DESFire Clear Records”
command.
Host Reader
REQUEST-DATA
(1) (1) (2) (1) (2) (3) (3)
FILE- FILE- MAX NUM
APPLICATION ISO7816 RECORD
FILE-NO COMM- ACCESS- OF
LEVEL FLAGS FILE ID SIZE
SETTINGS RIGHTS RECORDS
[optional] LSB MSB LSB MSB LSB MSB
FILE-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
ISO7816 FILE ID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-ACCESS-RIGHTS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
RECORD SIZE
This parameter specifies the size of one single record in bytes.
This command is used to create files for multiple storage of structural data, for example for logging
transactions, within an existing application on the PICC. Once the file is filled completely with data
records, the PICC automatically overwrites the oldest record with the latest written one.
Host Reader
REQUEST-DATA
(1) (1) (2) (1) (2) (3) (3)
FILE- FILE- MAX NUM
APPLICATION ISO7816 RECORD
FILE-NO COMM- ACCESS- OF
LEVEL FLAGS FILE ID SIZE
SETTINGS RIGHTS RECORDS
[optional] LSB MSB LSB MSB LSB MSB
FILE-NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
ISO7816 FILE ID
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-ACCESS-RIGHTS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
RECORD SIZE
This parameter specifies the size of one single record in bytes.
This command permanently deactivates a file within the file directory of the currently selected appli-
cation.
Host Reader
REQUEST-DATA
(1) (1)
APPLICATION FILE NO
LEVEL FLAGS
FILE NO
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
Bit: 7 6 5 4 3 2 1 0
Function - - - - - - - FREE
ACCESS
The DESFire Read Standard Data command allows the read form DESFire standard data files or
backup data files. Depending on the used parameters the reader performs CRC and CMAC check-
ing and deciphering of the data to be read as well as chaining.
Host Reader
REQUEST-DATA
(1) (1) (1) (3) (3)
DATA
FILE-COMM-
MANIPULATI FILE-NO FILE-OFFSET DATA-LEN
SETTINGS
ON FLAGS
LSB MSB LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-OFFSET
Defines the byte position within the file where the read process shall start.
The DESFire Write Standard Data command allows to write to DESFire standard data files or back-
up data files. Depending on the used parameters the reader performs ciphering, padding and all
further calculations which are necessary to write ciphered or MACed data as well as chaining.
To write data to a backup data file the DESFire commit transaction command has to be performed
by the user application after DESFire Write Standard Data command.
Host Reader
REQUEST-DATA
(1) (1) (1) (3) (3) (1…1024)
DATA
FILE-COMM-
MANIPULATI FILE-NO FILE-OFFSET DATA-LEN DATA
SETTINGS
ON FLAGS
LSB MSB LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-OFFSET
Defines the byte position within the file where the write process shall start.
DATA-LEN (0...1024)
Defines the number of bytes which shall be written.
DATA:
Data to be written.
NOTICE:
The no of data bytes to be written shall correspond with DATA-LEN.
The DESFire Get Value command allows to read the currently stored value from a value file. De-
pending on the used parameters the reader performs CRC and CMAC checking and deciphering of
the data to be read.
Host Reader
REQUEST-DATA
(1) (1) (1)
DATA
FILE-COMM-
MANIPULATI FILE-NO
SETTINGS
ON FLAGS
Host Reader
(4)
RESPONSE-DATA
LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
The DESFire Credit command allows to increase the value stored in a value file. Depending on the
used parameters the reader performs ciphering, padding and all further calculations which are ne-
cessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (4)
DATA
FILE-COMM-
MANIPULATI FILE-NO CREDIT-VALUE
SETTINGS
ON FLAGS
LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
CREDIT-VALUE
Value which shall added to the value stored in the value file.
The DESFire DEbit command allows to decrease the value stored in a value file. Depending on the
used parameters the reader performs ciphering, padding and all further calculations which are ne-
cessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (4)
DATA
FILE-COMM-
MANIPULATI FILE-NO DEBIT-VALUE
SETTINGS
ON FLAGS
LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
DEBIT-VALUE
Value which shall subtracted from the value stored in the value file.
The DESFire Credit command allows a limited increase of a value stored in a value file without hav-
ing full Read&Write permissions to the file. Depending on the used parameters the reader performs
ciphering, padding and all further calculations which are necessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (4)
DATA
FILE-COMM-
MANIPULATI FILE-NO CREDIT-VALUE
SETTINGS
ON FLAGS
LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
CREDIT-VALUE
Value which shall added to the value stored in the value file.
The DESFire Write Records command allows to write data to a record in a cyclic or linear record file.
Depending on the used parameters the reader performs ciphering, padding and all further calcula-
tions which are necessary to write ciphered or MACed data.
Host Reader
REQUEST-DATA
(1) (1) (1) (3) (3) (1…1024)
DATA
FILE-COMM-
MANIPULATI FILE-NO FILE-OFFSET DATA-LEN DATA
SETTINGS
ON FLAGS
LSB MSB LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-OFFSET
Defines the byte position within the file where the write process shall start.
DATA-LEN (0...1024)
Defines the number of bytes which shall be written.
DATA:
Data to be written.
NOTICE:
The no of data bytes to be written shall correspond with DATA-LEN.
The DESFire Read Read Records command allows the read out a set of complete records form
cyclic or linear record file. Depending on the used parameters the reader performs CRC and CMAC
checking and deciphering of the data to be read as well as chaining.
Host Reader
REQUEST-DATA
(1) (1) (1) (3) (3) (3)
DATA
FILE-COMM- RECORD- NO- OF- RECORD-
MANIPULATI FILE-NO
SETTINGS OFFSET RECORDS SIZE
ON FLAGS
LSB MSB LSB MSB LSB MSB
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
s see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
RECORD-OFFSET
Defines the record number within the file where the read process shall start.
NO-OF-RECORDS:
Defines the number of records which shall be read.
RECORD-SIZE
Defines the number of byte of one record which shall be read.
NOTICE:
The NO-OF-RECORDS multiplied with RECORD-SIZE shall be less than 1024 Byte.
(NO-OF-RECORDS * RECORD-SIZE 1024)
The DESFire Clear Record File command allows to reset a cyclic or linear record file to the empty
state.
Host Reader
REQUEST-DATA
(1) (1) (1)
DATA
FILE-COMM-
MANIPULATI FILE-NO
SETTINGS
ON FLAGS
FILE-NO:
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
FILE-COMM-SETTTINGS
see chapter 2. [0xC3] Flexible commands for DESFire Communication with SAM
The DESFire Commit Transaction command allows to validate all previous write access on Backup
Data Files, Value Files and Record Files within one application.
Host Reader
REQUEST-DATA
(1)
DATA
MANIPULATI
ON FLAGS
The DESFire Abort Transaction command allows to invalidate all previous write access on Backup
Data Files, Value Files and Record Files within one application.
Host Reader
REQUEST-DATA
(1)
DATA
MANIPULATI
ON FLAGS