National Railways Federation

Branch federation of the railway operating cooperatives

CARD-ROM, Dubrazec standard, revision 3

CARD-ROM is a removable storage device. A read-only block stores the identity, an 8 KB EEPROM keeps the options, the display language and 7.6 KB the holder may write, and a minified NAND stores the last ninety days of records. The gates and machines that read it run FreeRTOS and mount the card as a block device. Fluid issues these cards without a fare module, so the card cannot hold money.

  • 3 memories
  • 2 MB NAND
  • 8 KB EEPROM
  • 256 B ROM identity
  • 212 kbit/s

The object

  • The card

    ID-1 format, 85.60 by 53.98 mm, 0.84 mm thick, polycarbonate, white with the blue band. It cannot store names or photographs. The UUID, shown as XX:XX:XX:XX:XX:XX:XX, is displayed on the panel when a machine reads it and not on its face.

  • The hologram

    An authentic card issued in Iosmein, the Republic of Fluid or Reformed Luces Aporia will show the image and hologram of the building of the Ministry of Transportation of Reformed Luces Aporia at Dubrazec, where the standard was signed. A card without it still reads, and the machine will say where it came from.

  • Two ways in

    A contactless coil at 13.56 MHz for the gates, and six contact pads for the machines. The machine uses the pads when writing options, language, and records can be transfered when two cards are merged.

  • Issue and replacement

    Any machine on any concourse issues one, without charge and without a question asked. A lost card is replaced the same way. Records on the lost card stay and expire with it.

Memory

Three regions, addressed separately. The reader selects a region before it addresses a byte.

Regions of a Dubrazec revision 3 card
Region Size Type Write Stores
ROM 256 B mask ROM never Card UUID of 7 bytes, standard revision, issuer, mint date, issuer public key, signature over the block.
EEPROM 8 KB EEPROM, 106 cycles machine, by contact 410 bytes of options, language and counters. The other 7.6 KB belong to the holder.
NAND 2 MB SLC NAND, minified gate and machine Records. 512 B pages, 16 KiB blocks, 128 blocks. Four are held in reserve for bad blocks and one stores the commit journal, so a card pulled out of the field mid-write loses nothing.
EEPROM layout, byte offsets
Offset Length Field Note
0x0000 2 Layout revision 0x0004 for this revision.
0x0002 2 Display language Two letters, ISO 639-1. The machine writes what the holder picks from the list.
0x0004 1 Script 0 Latin, 1 Cyrillic, 2 kana and kanji, 3 Greek.
0x0005 1 Type size 0 standard, 1 large, 2 largest.
0x0006 1 Sound Gate tone on or off, and its pitch.
0x0007 1 Assistance flag Set by the holder. The gate holds open longer and the platform staff are told help was asked for.
0x0008 8 Home station Station identifier, or zero. The machine sorts the section list by it.
0x0010 16 Reserved Zero in Fluid. A network that compiles the purse module in uses it.
0x0020 224 Network options Options a network may define. Fluid uses 12 bytes of it.
0x0100 154 Counters Block wear, bad block table, and the count of records written since issue.
0x019A 7,782 The holder's area 7.6 KB, free. Emergency contact, medical information, other cards merged in, and up to 4 KB of plain text.

The holder's area is read by any terminal in the Republic. Written data is stored and returned; it is never executed. What goes in it is the holder's decision, and a card with nothing written in it works the same at every gate.

Records

The NAND stores a list of records. A card can store about 60,000 of them, far past what is practically necessary, and the oldest are overwritten first.

Record structure
Offset Length Field Note
0 4 Stamp Minutes since 1 January 2000, local standard time.
4 8 Station Where the card was presented.
12 8 Section The pair of stations the record covers, or zero for a presentation with no section chosen.
20 1 Count How many people the record covers, 1 to 9.
21 1 Kind 0 gate, 1 machine, 2 on board, 3 merge, 4 issue.
22 2 Operator The cooperative that took the record.
24 8 Seal Truncated AES-CMAC over the record, under the key of the network that wrote it.

There is no value field, no balance, and no field a fare could be written into. The optional fare and purse modules of the Dubrazec standard are compiled out of every card and reader in the Republic. What a network outside the Republic compiles in is set out on the build flags page.

Command set

Commands of the Dubrazec standard, revision 3
Code Command Needs Does
0x01 SELECT field only Wakes the card and returns the standard revision and the region sizes.
0x02 READ_ID field only Returns the ROM block with its signature. Any reader may do this.
0x03 AUTH network key Mutual authentication, AES-128, key diversified per card. Opens the record region.
0x04 READ_OPT AUTH Reads a range of EEPROM.
0x05 WRITE_OPT AUTH, contact Writes options, language and locale. Refused over the coil.
0x06 READ_REC AUTH Reads records, newest first, up to 64 in a frame.
0x07 APPEND_REC AUTH Journals a record and commits it. The gate uses this and nothing else.
0x08 MERGE AUTH on both cards, contact Copies the records of a second card and marks that card spent. Also takes in a library card, a tool lending card or a membership card, which land in the holder's area.
0x09 EXPIRE AUTH Drops records older than ninety days. The machine runs it on every presentation.
0x0A STATUS AUTH Returns wear counters, the bad block table and the record count.
0x0B READ_FREE field only Reads the holder's area. Open to any terminal, which is why the machine warns before writing there.
0x0C WRITE_FREE contact Writes the holder's area. Refused over the coil.

WRITE_OPT, WRITE_FREE and MERGE are refused over the coil in every build. A card in a pocket cannot have its language changed, its options altered, or its records taken by a reader held near it.

Electrical

Carrier
13.56 MHz ± 7 kHz
Field strength
1.5 to 7.5 A/m rms
Modulation to card
ASK 10 per cent, Miller coded
Modulation from card
Load, subcarrier 847.5 kHz, BPSK
Bit rate
212 kbit/s, falling back to 106 kbit/s
Coil
4 turns, 68.0 by 42.0 mm, on layer 2
Inductance
2.02 µH ± 5 per cent
Chip capacitance
68 pF ± 3 per cent
Resonance, unloaded
13.9 MHz, tuned 2.5 per cent high for card stacks
Quality factor
26 to 34
Power drawn
4.5 mW reading, 9.8 mW during a NAND commit
Reservoir
4.7 µF, sustains a commit through 40 ms out of field
Contact pads
6, ISO 7816-2 positions C1 to C4, C7, C8
Contact supply
3.0 V, 15 mA peak
Working range
0 to 45 mm from the gate antenna
Temperature
−25 to +60 °C operating
Where the time goes in a gate transaction
Step Typical Worst
Field detect and SELECT 12 ms 21 ms
READ_ID and signature check 28 ms 44 ms
AUTH 46 ms 72 ms
EXPIRE, when due 0 ms 38 ms
APPEND_REC, journal and commit 62 ms 104 ms
Gate opens at 148 ms 279 ms

The reader

The card has no processor. It answers commands and stores bytes. Everything decided in a transaction is decided by the gate or the machine.

The gates and machines run FreeRTOS. The gate is a Cortex-M4 at 120 MHz with 256 KiB of RAM and has been programmed with four tasks: field, transaction, door, and the panel. The transaction task has a deadline of 300 ms, and the door task will not open on a transaction that missed it.

The card mounts as a block device. The reference driver presents the three regions to FreeRTOS as read-only, read-write and append-only devices. It is 3,100 lines of C, it allocates nothing after start, and it is published with the standard.

A machine is the same board with a slot. The concourse machine adds the contact carrier, the printer and the panel, and runs the same driver over the pads at 15 mA.

Security

  • Keys

    AES-128 mutual authentication, one master key per network, diversified per card over the ROM identifier. Keys sit in a secure element in the gate, and a gate that loses power comes back without them until a worker unlocks it.

  • Signatures

    The ROM block is signed by the issuer with Ed25519. A reader anywhere in the Bloc can check that a card is authentic without storing any network key.

  • Records are sealed

    Each record is sealed with a CMAC under the key of the network that wrote it. A record written by another network can be read and counted, and it cannot be forged.

  • What is not there

    No name, no address, no date of birth, no photograph, no balance, and no field a score could be written into. Article 51(7) prohibits the scoring and profiling that such a field would allow.

The standard

The standard is open. It was signed at the Ministry of Transportation at Dubrazec, in Reformed Luces Aporia, and it is published in full with its test vectors and its reference driver.

It works across the Bloc. A card issued in Iosmein, the Republic of Fluid or Reformed Luces Aporia is read by the gates of all three. Sections crossing a frontier are recorded by whichever network the gate belongs to.

A fork may add modules. The fare module and the purse module are part of the standard and are compiled out here. A transit system elsewhere may compile them in, keep the record structure, and stay readable by the gates of the Bloc. The forking guide and the build flags set out what may change and what may not.

The comparison is published too. How CARD-ROM stands against MIFARE Classic, DESFire EV3, FeliCa and Calypso is on the comparison page, with the figures each one is measured by.