• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

NFC Oyster card reader app for Android?

Status
Not open for further replies.

cjp

Member
Joined
28 Jan 2012
Messages
1,059
Location
In front of a computer
Does such a thing exist?
All the apps I have found act only as a gateway to TfL's site or data for registered cards.

All I want to do is for my phone to read the balance off my card and tell me what it is . I do not want to get tfl back office data (my travel history) unless it is held on the card and the app reads it and displays it to me.
I can see no point in associating my phone and an oyster account when all I want is the data on my card without a network or WiFi connection being required.
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

sor

Member
Joined
15 Nov 2013
Messages
780
Here is a foi for the oyster card data. https://www.whatdotheyknow.com/request/data_stored_on_oyster_cards_2011

However their response is that the data is encrypted and that only tfl devices can decode this data. Explains why there is no nfc app to read them. Also they could be reprogrammed for free travel if this was the case.

IIRC ITSO cards will spit out some information if read by the right phone app, so that's really a design choice by TfL

e.g. https://play.google.com/store/apps/details?id=com.ecebs.cardviewer

Not that I'm aware of, for the reason mentioned by BigFoot - if the data can be read, it can be changed.

My understanding is that the Mifare cards used are fairly intelligent and designed to prevent unauthorised writes (and you could presumably sign the data that is being written?)
 
Last edited:

asylumxl

Established Member
Joined
12 Feb 2009
Messages
4,260
Location
Hiding in your shadow
Actually, that's not quite true.

I believe current Oyster cards are MIFARE DESFire, and as such if someone wanted to make an app that supports these cards they could use MIFARE's SDK (located here).
 

jnty

Member
Joined
21 Jun 2013
Messages
33
Not that I'm aware of, for the reason mentioned by BigFoot - if the data can be read, it can be changed.

This isn't really true in the sense that you mean - if I give you a message to pass on to a third person, I can crypographically sign it so that, provided I give the third person a bit of information (my "public key") in advance, they can tell if you've tampered with it. It doesn't even matter if you know my public key too, you can't forge my signature without a another bit of information only I have (my "private key".)

No idea if this is how it actually works - this is just to illustrate that the "can be read = can be changed" principle doesn't always apply - but the oyster card can be modelled as someone trying to send a message to itself via the card. It doesn't matter if the message can be plainly read as 'THIS PERSON HAS £5.50 ON THEIR CARD' - provided it is properly signed, tampering with the balance is impossible.
 

najaB

Veteran Member
Joined
28 Aug 2011
Messages
33,592
Location
Scotland
My understanding is that the Mifare cards used are fairly intelligent and designed to prevent unauthorised writes (and you could presumably sign the data that is being written?)
If someone figures out the data format then they can, theoretically at least, write that data to a card that pretends to be a Mifare card.

No idea if this is how it actually works - this is just to illustrate that the "can be read = can be changed" principle doesn't always apply - but the oyster card can be modelled as someone trying to send a message to itself via the card. It doesn't matter if the message can be plainly read as 'THIS PERSON HAS £5.50 ON THEIR CARD' - provided it is properly signed, tampering with the balance is impossible.
"Impossible" and "computationally difficult" aren't the same thing. There are more and more high-powered number crunching rigs out there thanks to Bitcoin mining, if the signing algorithm is weak (not that I'm saying that it is) then it's entirely possible that it could be brute-forced.

'Security through obscurity' is seen (unfortunately) to be a substitute for good secure design. Even if it is a good underlying design, keeping the data encrypted and the structures out of the public domain makes it that much harder for the crackers to figure things out as there's one more layer that they need to break.

Oyster is a high-profile target so I can understand why they are paranoid about people knowing anything about the details of the data fields.
 
Last edited:

sor

Member
Joined
15 Nov 2013
Messages
780
If someone figures out the data format then they can, theoretically at least, write that data to a card that pretends to be a Mifare card.

Provided that you work out any private keys TfL/ITSO/the card issuer is using - which is rather unlikely.

It seems that ITSO has not considered it risky to make everything open - including the full specifications - e.g. https://www.itso.org.uk/wp-content/uploads/2012/09/Customer-Media-Data.pdf, and third parties have written readers on Android that appear to have the backing of ITSO themselves that will display ticket and balance info with no issues

'Security through obscurity' is seen (unfortunately) to be a substitute for good secure design. Even if it is a good underlying design, keeping the data encrypted and the structures out of the public domain makes it that much harder for the crackers to figure things out as there's one more layer that they need to break.

This doesn't seem to be problematic for ITSO and other Mifare users?

If the cryptographic algorithm (e.g. AES) were totally broken it wouldn't matter how much encryption is used.

Having signed but plain-text data doesn't seem to me to be any more insecure than fully encrypted data - as the point here is to make it publicly readable, while still hard/impossible for a third party to rewrite and hence proves that it is authentic - and in both cases you need the correct private keys. Sounds like the perfect job for signing vs encryption (and also potentially reduces the risk of losing a card reader? I'm guessing that the TfL handheld readers or the store terminals have to store some sort of encryption key to be able to read Oyster cards)

I'd assume that Bitcoin miners are designed for the exact intricacies of Bitcoin's hashing process, and probably won't do very well on anything outside of that (hence miners that are unprofitable to mine just get switched off and used as doorstops, rather than used on something else)

Oyster is a high-profile target so I can understand why they are paranoid about people knowing anything about the details of the data fields.

Oyster isn't the only Mifare user though - so there'll be tons of people trying to break it even if it were readable or not - IIRC the original Mifare hack was performed on the Netherlands' chipkaart
 
Last edited:

najaB

Veteran Member
Joined
28 Aug 2011
Messages
33,592
Location
Scotland
It seems that ITSO has not considered it risky to make everything open...
If you have a well-designed security scheme then it's a good idea to keep things open. Security through obscurity is a bad idea. My suspicion, and it's only that, is that Oyster is not a well designed implementation, which would explain why they are resistant to making the info public.
This doesn't seem to be problematic for ITSO and other Mifare users?
Which could be explained by them having a better underlying implementation for the data.
Having signed but plain-text data doesn't seem to me to be any more insecure than fully encrypted data - as the point here is to make it publicly readable, while still hard/impossible for a third party to rewrite and hence proves that it is authentic - and in both cases you need the correct private keys. Sounds like the perfect job for signing vs encryption (and also potentially reduces the risk of losing a card reader? I'm guessing that the TfL handheld readers or the store terminals have to store some sort of encryption key to be able to read Oyster cards)
I agree. However it appears (from the outside) that isn't the way that they've done things. My WAG is that they have a crappy implementation and thought - "just encrypt the lot and it'll be okay".
I'd assume that Bitcoin miners are designed for the exact intricacies of Bitcoin's hashing process, and probably won't do very well on anything outside of that (hence miners that are unprofitable to mine just get switched off and used as doorstops, rather than used on something else)
I'm pretty sure they could be re-purposed, given that Bitcoin mining is just hashing. It should be relatively straightforward to put them to work on a different algorithm - most early bitcoin mining was done with GPUs. The reason that they get scrapped is because they aren't any good for mining any more.
 

JGR

Member
Joined
31 Jan 2012
Messages
147
Location
Ipswich
I'm pretty sure they could be re-purposed, given that Bitcoin mining is just hashing. It should be relatively straightforward to put them to work on a different algorithm - most early bitcoin mining was done with GPUs. The reason that they get scrapped is because they aren't any good for mining any more.
Economic Bitcoin mining rigs are ASICs these days, there's no way to get them to do anything else of use. Public key signing algorithms and AES are nothing like hashing at any rate.
Trying to brute force signatures/keys is probably not worth the bother when there are far easier and more lucrative methods and targets available.

Even if you do manipulate the stored values on the card, given that ticket barriers and machines periodically report Oyster transactions back to base, it wouldn't be long before your card gets noticed.
 

cjp

Member
Joined
28 Jan 2012
Messages
1,059
Location
In front of a computer
so I guess the answer is No then :(

It does seem to me though that if they wanted they could a copy of the latest balance into a clear part that could be read whilst maintaining a real balance in an encrypted part part for use by the system.
In otherwords even if the clear part was hacked to £1,000 it would make no difference to the true Oyster balance.
 
Last edited:

button_boxer

Established Member
Joined
12 Nov 2009
Messages
1,271
so I guess the answer is No then :(

It does seem to me though that if they wanted they could a copy of the latest balance into a clear part that could be read whilst maintaining a real balance in an encrypted part part for use by the system.

Yes they could, but every extra operation increases the amount of time you have to hold the card over the reader to complete a transaction. You're asking them to slow down every single touch in/out for every Oyster user in order to provide functionality that only a tiny fraction of one percent of users would care about.
 

jon0844

Veteran Member
Joined
1 Feb 2009
Messages
30,844
Location
UK
There's an Android app that pretends to do it, by simply loading the app when you tap your Oyster card against it. But it does it for any NFC device, so is really rather pointless.

Meanwhile, I can scan my passport. As long as I give the app some key details, it will then download all of the information as shown on the photo page - including the image of myself.

But it won't show most other information that is encrypted.

So, I'd imagine you could have a way for someone to register an app on a device, entering key information that is 'public' but not known by anyone that found the card, and then to read certain information.

I had an app that worked with the HK Octopus cards and showed a balance, and I'm surprised we can't do that with Oyster - but there are many reasons as suggested above. Hopefully the replacement to Oyster will be designed to work well with apps or other NFC readers, allowing you to check travel, balances, make top ups and add tickets/seasons all from your phone/tablet.

Sure, you could argue that the phone becomes the smartcard but I still think there are many reasons for still wanting a separate card.
 

radamfi

Established Member
Joined
29 Oct 2009
Messages
9,267
I had always wanted such a reader for piece of mind. I wanted to be able to double check whether I had touched in or out. However, with contactless you can check online while you are travelling, and in any case there is no information stored on your card, and that will be the same with the future 'dumb Oyster'.
 

button_boxer

Established Member
Joined
12 Nov 2009
Messages
1,271
Meanwhile, I can scan my passport. As long as I give the app some key details, it will then download all of the information as shown on the photo page - including the image of myself.

But it won't show most other information that is encrypted.

Passports are a slightly different case. They're encrypted against casual snooping but the key is derived from information printed on the machine readable part of the photo page so anyone (or any app) with access to this data can decrypt it. That's why e-passport gates at immigration require you to open your passport - they do an optical scan of the info page to derive the encryption key they need to get the biometrics from the chip.
 

starrymarkb

Established Member
Joined
4 Aug 2009
Messages
5,985
Location
Exeter
And the gates take a while to download it. You have to hold your passport in place for about 10 seconds.
 

infobleep

On Moderation
Joined
27 Feb 2011
Messages
13,451
The mayor, Boris Johnson is very keen for open data and sharing. Whilst one wouldn't want to share Oyster balances it would make sense to make an API available so app developers can design apps which can access the data.

If not why doesn't TFL design their own. I wouldn't mind having an app I can load up.
 
Status
Not open for further replies.

Top