-
Notifications
You must be signed in to change notification settings - Fork 71
Oyster
Oyster is a public transit smartcard used in London, UK, administered by Transport for London (TfL). It is different to the national ITSO card.
The system was developed by Cubic, but uses a different card format to other Cubic systems.
Oyster has two types of card media:
-
an older, Mifare Classic 1K based card.
This is a different format to Cubic Nextfare MFC.
-
a newer, Mifare DESFire based card (rolled out from 2009-12). These have a "D" printed in the lower left corner of the card.
The newer DESFire cards have no freely readable sectors, so until there is work on breaking the authentication system on DESFire, this won't be supported in Metrodroid.
This is a different format to Cubic Nextfare MFD.
In addition, single-use TfL tickets are either magnetic-stripe or Aztec Barcodes.
Despite being no longer issued, these are still valid for travel on TfL services.
Unless otherwise specified, all values here are little endian.
Times are stored in local time (Europe/London
).
This is a work in progress, and more information is needed (annotated dumps) to improve this reader.
Sector | Block | Content |
---|---|---|
0 | 1 | Card magic (964142434445464748494A4B4C4D0101 ) |
0 | 2 | All FF
|
1 | 0 | Configuration, serial number |
1 | 1-2 | Balance |
2 | 0-1 | unknown, writes alternate |
5 | 0-2 | Refills (PAYG) |
7-8 | 0-2 | Travelcards / Passes |
9 | 1-2 | Transactions |
10-13 | 0-2 | Transactions |
14-15 | 0-2 | All FF
|
First | Last | Length | Field description |
---|---|---|---|
1 | 5 | 4 | Card serial number, excluding last two digits |
Values are indicated in bits.
First | Last | Length | Field description |
---|---|---|---|
0 | 3 | 4 | ??? |
4 | 7 | 4 | Sub-journey sequence number |
8 | 15 | 8 | Journey sequence number |
25 | 39 | 15 | Balance in pence (0.01 GBP) |
Values are indicated in bits.
First | Last | Length | Field description |
---|---|---|---|
0 | 25 | 26 | Timestamp of refill |
74 | 87 | 14 | Refill amount in pence (0.01 GBP) |
Values are indicated in bits.
First | Last | Length | Field description |
---|---|---|---|
0 | 5 | 6 | ??? |
6 | 31 | 26 | Timestamp of transaction |
32 | ... | ... | ??? |
This is based on very limited information.
Sector 7 and 8 appear to act as pairs (eg: Sector 7 Block 0 goes with Sector 8 Block 0).
Sector | First | Last | Length | Field Description |
---|---|---|---|---|
7 | 33 | 58 | 26 | End timestamp |
8 | 0 | 15 | 16 | Cost in pence (0.01 GBP) |
8 | 78 | 103 | 26 | Start timestamp |
Values are indicated in bits.
All timestamps are the following format (26 bits total):
First | Last | Length | Field description |
---|---|---|---|
0 | 14 | 15 | Date, in days since 1980-01-01 |
15 | 25 | 11 | Time, in minutes since 00:00 |