Top Latest Append

pterjan's diary


  Navigo card decoding

After buying the card reader, I had to use it, so I had a look at the content of my Navigo card.

Navigo is a French transport card, implementing Calypso standard

« The European standard for ticketing data (EN1545) has also been contributed by the actors of Calypso. After a few years of trials, the system has been generalised in the early 2000's in major European cities such as Lisbon, Paris, Venice, later followed by Milan, Porto, Marseille, Lyon, Turin, and many smaller cities. Calypso is extended now in other countries such as Belgium, Israel, Canada, Mexico, Colombia, etc. »

So, hopefuly this info will be useful to people in these places. Please let me know :)

Seat in Bois-Colombes
Seat at my train station under snow on December 17

EN1545 is an expensive document, so I could not access it and had to reverse the data in my card, here is what I found. All of this is based on data collected with Integrale subscription. Bits are numbered starting at 1 because I used cardpeek to work on the data, which uses lua where we count from 1.

Before looking at the real data, all the cards I saw where 3B6F0000805A080303000000CARD NUMBER829000 with CARD NUMBER using 8 hex digits.

Event log

Then we can start with event log which is the one I spent most time one. It contains the last 3 uses of the card. Reading it for a few days, and reading the ones of my colleagues gave me plenty of information (many thanks #bureau3).

I have split each record into two parts, the first part is 68 bits long, the second part is 38 to 86 bits

First Part

1    5    9    13   17   21   25   29   33   37   41   45   49   53   57   61   65
  • D: Days since 01/01/1997
  • T: Minutes since midnight
  • B: 3 for Bus, 0 for other
  • C: 1 for Metro and some Bus, 0 for Train and some Bus. Related to length of second part
  • K: 1 for Bus, 3 for Metro, 4 for Tram 5 for Train
  • R: 1 for Entry, 2 for Exit, 6 for a Metro to Train transition, 7 for Train to Metro transition
  • X: 58 found on a non RATP bus, 1 for everything else

Second Part
This part is varying a lot.

  • For SNCF trains it is 38 bits long, for metro or RER, 54 bits.
    69   73   77   81
    YSSS SSSS AAAA A??? ... ?000 01
    • S: Sector
    • A: Station

    For a list of sectors and stations, refer to this page and this one.

  • For bus, if C=0, it is 68 bits and Bus number is 13 bits starting at bit 121. Else it is 86 bits and Bus number is 13 bits starting at 137. Bus line is sometimes 8 bits starting at 110.


  • 14 bits stating at 86: Days since 01/01/1997 for the contract subscription date
  • 14 bits stating at 100: Days since 01/01/1997 for the contract end
  • 8 bits starting at 114: Allowed zones as a bitfield, 114 is zone 8, ..., 121 is zone 1


After finding all of this I found a PDF on Google describing coding for interoperability in France between cities using EN1545. I was happy because it both confirmed that I was right on most things, and because it contains a lot of information, like the additional codes for other kinds of transport, the complete coding for event log (the changing length indeed depended on some previous bits, each structure has a bitmap telling which fields will be there).

All the result of my findings, and some from that PDF are in a fork of cardpeek that I maintain there (because the author did not reply to my email with a first patch one month ago). I fixed a few issues in cardpeek but not the main one: it copies lua decoders to ~/.cardpeek/scripts the first time you run it and they never get updated. To workaround that, I replaced that directory with a symlink to my git checkout...

While collecting data I had some surprise, for example Tramway T4 in one station (La remise à Jorelle) did not write anything to event log, does this mean that they can't control you? T3 does, and T4 did in the next station Les coquetiers.

More expected, using your navigo card to get a Velib bike does not write anything, they just use the id of your card.

Plenty of Velib available today
Velib station under snow on December 17

I also happily could not find some data that I would not have liked to find as they are accessible via RFID too, like my name, birth date, ...

Today's TSUKKOMI(Total: 4) [Add a TSUKKOMI]


  Wiflye81 [This is very interesting, hopefully for us, it seems personal data are encrypted. Do you know if I can still buy this ..]

  Pascal [Sorry, their test offer is finished, they no longer sell it at all currently. I don't know what will be the public pri..]

  liberforce [Pascal, if you have specific questions, you can ask me as I'll work until March for RATP ;-). I eat with the card guys..]