Would there be any fool proof alternative to allow for offline ticket creation in a mobile app when that app can be reverse engineered?
Would there be any fool proof alternative to allow for offline ticket creation in a mobile app when that app can be reverse engineered?
- Phone registers public key with backend during signup.
- Phone generates ticket signed with private key.
- Backend checks signed ticket against registered public key to charge customer.
Fraud is still possible but limited to individual customer accounts.
- phone displays the generated ticket to the ticket scanner in the bus. - the scanner connects to the backend to verify the ticket.
this way the phone can remain offline after registration, and only need to get online to send money for your account.
i see no way for possible fraud as in fact all the ticket is doing in that case is to verify your identity to the server.
now how can we do the same thing but without revealing your identity, but just verifying that you paid?
I think the signed ticket scheme would have been better used for redeeming already issued tickets or tickets to identity verified previously.
Issuing a ticket with pre-signed identity token is essentially a good faith transaction - it is not guaranteed to be valid end to end - but you can compare against a blacklist of identities at redemption time to limit the impact of someone abusing the system.
The commuter rail lines in New York want to charge a premium for issuing a ticket onboard so they have this whole scheme where you have to activate an e-ticket before you leave the station and then it’s only good for an hour, and 90% of the time they don’t validate it - just see that a QR code is on your phone - the other ten percent of the time they want you to swipe or do something to prove it’s not just a screen shot. It can lead to a lot of drama in areas where the cell service is weak or none, or accidentally closed the app, and people don’t have cash on them. I think signing the tickets could solve a lot of the drama. If the conductor has internet connectivity he can validate and redeem tickets in real time, if not then the conductor can validate in real time, make sure no one else on the train has a duplicate ticket, and redeem in bulk when they get into cell range again.
Issue an asym key to a user upon them registering their official bank details. Backend holds one side of it (not sure whether to call this the pub or priv).
User uses the asym key to sign a message and shows that message to the inspector (in reality, QR code or similar).
If the user cheats you go after the account holder behind the key for reconciliation.
edit: Doesn't work as you need to enforce buying even if unchecked.
What does work is providing a way to check-in and out of transport via gates or poles not under the control of the traveller with a token like the Oyster card.
You have no way of detecting whether a user "bought a ticket" on seeing the inspector or not.
It has to be partially online, how do you pay without an online connection? Is there some kind of amount you have and then you can redeem them offline?
At one point you do require an online check in, that's for sure, that's when you find out whether the tickets were bought only when checked or not.
Alternatively, Apply Pay works offline for NFC transactions - I've not tried doing an in-app purchase offline but that might work too.
Apple Pay is a little different in that the terminal is online - I was under the impression all contactless terminals perform auth in real-time, but I may be mistaken.
The terminals in London Underground stations might be constantly online, but I doubt very much there's a 100% guarantee for London Buses.
However, there is also a blacklist of card numbers that have outstanding balances against them. If you try to use a card that is declined, it will work the first day but not on subsequent days. If you go on TfL's website and clear the outstanding balance, the card will work again after 30 minutes (or in practice, less) once it is removed from the blacklist.
The card (on behalf of its owner) gets to say e.g.
"Hi, I am allowed to authorise $185 more offline before talking to my owner. I am allowed to do PIN transactions also I have a magstripe. What shall we do now?"
And a terminal could say "OK, let's do an online $28 transaction, with proof of PIN" or, "I'm good, $5.80 offline and no need for a PIN".
All this complexity opens up a bunch of potential problems (and EMV is guilty of not getting in a team of academics to figure out the cryptographic situation before shipping it, so it has had to be repeatedly patched and has a bunch of issues that needn't exist) but it allows Apple Pay to decide that e.g. you can spend up to $50 per time, and so long as you make an online transaction at least once per week and without spending more than $250 offline that's fine.
Both the issuer of the card and the terminal's owner get to decide on their appetite for risk. Probably if you sell $500 gold chains from a location with bars on the windows and an airlock entrance you want to do online proof-of-PIN transactions only, even if the card itself says it's happy to spend $500 offline contactless - and if your bank is trying to rehabilitate someone with spending problems (in a country where just exploiting them isn't legal) its card may tell the guy with a street cart that alas you need to go online and do a PIN transaction even for their $6 bagel.
For some debit cards, the situation is that they only allow Authorization to occur online, and it will validate your balance before authorizing the transaction AND it will respond to Settlements which are unauthorised by always reversing them.
Most people don't want this, because it's annoying, but it can be an option for people who have (some) money but can't be trusted with debt, for example some problem gamblers. It would never be reasonable to give them a card they can spend more than they have on, because they will spend uncontrollably.
The distinction between Authorization and Settlement has a variety of weird consequences. For example:
If you lose a card and it has to be blocked by the issuer, transactions you Authorized with that card can still be Settled hours, days or even very occasionally weeks later despite the block.
Some merchants who determine their exposure to fraud is very low just don't bother with Authorization at all. They only do Settlement, and it Just Works™ because none of their customers were trying to defraud them or queries the bill. This is a really nice user experience, super low friction.
Modern Authorization has anti-replay features, because it's built out of technologies where that was essentially free. So you can't execute any Authorization more than once (but Light Blue Touchpaper has an example incident where bad RNG allowed bad guys to attack this). But Settlement still acts like reel-to-reel tape is exciting new technology so it has no anti-replay, and periodically a batch of Settlements will accidentally be executed twice, taking money from customers and giving it to merchants until enough related complaints happen for somebody to realise the mistake and fix it.
Now when offline, they can create their tickets by linking a token to a fare and sign that with their private key.
At check-in, collect those tickets and when online again, charge the credit card.
That’s much better, though it’s subject to some edge cases similar to the London Underground, caused by the potential for using invalid payment methods. Not bad though; probably low-enough potential for abuse to ignore.
Also, historically bus tickets do not exist to keep passengers honest. They exist to keep the drivers honest. A valid ticket tells the bus company that the driver isn't taking passenger money but not declaring that money to the bus company.
The vehicle ticket scanner would log all tickets and make sure they were charged.
So basically, as you can sign many times same token with different time value, there is no solution for offline generate and offline use scenario.
The UK makes travelling by public transport as tedious as possible.