Supported Commands
This section gives an overview on the commands that are available on the card and whether they're supported by this package. The list is based on public information on EV1 cards, and will likely not represent a full list of available commands. Additional EV2 and EV3 features are not part of this list (yet).
Authentication¶
Both supported authentication schemes are encapsulated in the authenticate() method.
| Code | Supported | Command | Note |
|---|---|---|---|
| 0x0A | Authenticate (Legacy) | Legacy DES authentication, 8-byte key length | |
| 0x1A | Authenticate (ISO) | 3DES (2 keys, 16 byte) or 3K3DES (3 keys, 24 byte) | |
| 0xAA | Authenticate (AES) | AES-128 (16 byte key length) | |
| 0x71 | Authenticate (EV2 First) | EV2 + EV3 only | |
| 0x72 | Authenticate (EV2 Non First) | EV2 + EV3 only |
Card Level Commands¶
These commands are not application or key specific.
| Code | Supported | Description | Method |
|---|---|---|---|
| 0x51 | Get Real UID | get_real_uid |
|
| 0x5C | Change PICC Configuration | change_default_key |
|
| 0x60 | Get card version | get_card_version |
|
| 0x6E | Get free memory | ||
| 0xFC | Format PICC | format_card |
Command 0x5C supports multiple sub-commands. Currently, only 0x5C01 is implemented, which is used to change
the default key that is used as master key when creating new applications.
Key Commands¶
These commands are for managing crypto keys on the PICC.
| Code | Supported | Description | Method |
|---|---|---|---|
| 0xC4 | Change key data and potentially type. | change_key_ |
|
| 0xC6 | Change Key (EV2 only) | N/A | |
| 0x55 | Roll Key Set (EV2 only) | N/A | |
| 0x56 | Initialize Key Set (EV2 only) | N/A | |
| 0x57 | Finalize Key Set (EV2 only) | N/A | |
| 0x45 | Get key settings of the master key of the currently selected application. | get_key_setting |
|
| 0x54 | Change key settings of the master key of the currently selected application. | change_key_settings |
|
| 0x64 | Get Key Version Byte | get_key_version |
Application Level Commands¶
These commands are used to manage applications on the card.
| Code | Supported | Description | Method |
|---|---|---|---|
| 0xCA | Creates a new application | create_application |
|
| 0xDA | Delete application | delete_application |
|
| 0xC9 | Create delegated application | N/A | |
| 0x5A | Select application | select_application |
|
| 0x6A | Get application ids | get_application_ids |
File Level Commands¶
Commands to create and update files within applications. There are multiple file types:
- Standard Data File (supported)
- Backup Data File (not supported)
- Value File (not supported)
- Linear Record File (not supported)
- Cyclic Record File (not supported)
- Transaction MAC File (EV2 only, not supported)
| Code | Supported | Description | Method |
|---|---|---|---|
| 0xCD | Creates a standard data file | create_standard_file |
|
| 0xCB | Creates a backup data file | N/A | |
| 0xCC | Creates a value file | N/A | |
| 0xC1 | Creates a linear record file | N/A | |
| 0xC0 | Creates a cyclic record file | N/A | |
| 0xCE | Creates a transaction MAC file | N/A | |
| 0xDF | Deletes a file | delete_file |
|
| 0x6F | Get file IDs within application | get_file_ids |
|
| 0x61 | Get ISO file ids | N/A | |
| 0xF5 | Get file settings | get_file_settings |
|
| 0xF6 | Get file counters | N/A | |
| 0x5F | Change file settings | N/A | |
| 0xBD | Read file data | read_file_data |
|
| 0x3D | Write file data | write_file_data |
|
| 0x6C | Get value | N/A | |
| 0x0C | Credit | N/A | |
| 0xDC | Debit | N/A | |
| 0x1C | Limited Credit | N/A | |
| 0xBB | Read Records | N/A | |
| 0x3B | Write Records | N/A | |
| 0xDB | Update Records | N/A | |
| 0xEB | Clear Record File | N/A | |
| 0xC7 | Commit Transaction | N/A | |
| 0xA7 | Abort Transaction | N/A | |
| 0xC8 | Commit Reader ID | N/A |