The Lost Passport & Driving Licence Saga

I thought I would write a series of occasional articles about the kind of nonsense that fills my day, either at work or otherwise, and to kick this off I shall share with you how a software developer goes about replacing a lost driving licence. Think of the old “how many … does it take to change a light bulb” jokes, and you might see why we developers are not often allowed out to meet other people! In my defence, I had plenty of spare time because I was confined to bed for a few days, and Maria insisted that I was not allowed to work, otherwise I would have been hiding under the covers with my torch dashing off E-Quip code – honest!

On the way back from Dublin a couple of weeks ago I left my wallet (containing £100 and all my plastic) and passport (which had my driving licence in the same holder) on the long-stay parking bus at Stansted airport. This would be a pain at the best of times, but I’m  off to Italy shortly, for which the passport and driving licence would come in very handy.

So, first things first – all plastic cancelled. Next, how do I get a new passport and driving licence in 2 weeks. I can fast-track my passport application and get that within a week, so no problem there, but what about the driving licence? I can apply on-line, for which I need my current driving licence and passport numbers, but of all the important numbers that I can remember (the wife’s birthday, wedding anniversary, my old RAF service number, my first ever phone number, the number of yards in a mile and the coronation date of George III), I have no record of either of these two numbers. Incidentally, George III was crowned in 1760, which is the number of yards in a mile, so that should perhaps only count as one number.

The only way that I can get a driving licence without knowing my passport number is to apply by post, but unfortunately DVLA want all the same documents as the Passport Office, and neither of these will accept copies. This means that unless I want to wait 6 weeks I have no choice but to find these two numbers.

Getting my driving  licence number wasn’t too bad. When I changed my car a few months ago the nice people at Peugeot photocopied my licence, so all I had to do was call them, convince them that I was who I said I was, and they sent me a copy. So far, so good. Now for the passport number. I’d just come back from Dublin, and I still had a bit of my boarding pass – surely your passport  number is printed on that?

Diversion 1 – Boarding Passes

Had all this happened a year ago that would have been the end of the story, but Ryanair no longer print passport numbers on boarding passes.

However, just because the passport number doesn’t appear on the printed boarding doesn’t mean it’s not there! When your aircraft eventually arrives and you finally get to the end of the queue at the gate, there must be some way for the keen, efficient, polite & courteous Ryanair staff to check your passport number against your boarding pass. No prizes for guessing that it must be embedded in the data matrix bar code.

Unfortunately, I don’t happen to own a data matrix scanner, but I do own a mobile phone, and a little bit of searching found a couple of free “apps” for my phone which claim to be able to read bar codes. A after a little bit of experimentation with a packet of Paracetamol and a jar of anchovies I’m ready to move up from bar codes to data matrix. Unfortunately, while my phone could happily read bar codes, even though the software had an option to read data matrix labels, it failed at every attempt, so I’m back to square one.

By now I should have spotted all the characteristic signs of a project that was set to waste a huge amount of time, but, undaunted, I stumbled on. A bit more Googling told me that the standard symbology adopted by IATA for boarding passes is called PDF-417, and its use is defined by a standard called BCBP (Bar Coded Boarding Pass). Still more Googling found some web sites that can decode PDF-417 labels, and having far more spare time than common sense I persevered and headed to Success!

This is what is hidden in the boarding pass:




0 10 146 10 0 603 0 603 146

Surely my passport number is buried in that little lot somewhere – perhaps I should have stayed on the IATA BCBP web site a little longer! Any code is easier to crack if you have a crib, just ask Alan Turing, and I will admit that knowing that my name is Graham Stanbury and that the boarding bass was for flight FR 225 from Stansted to Dublin did contribute significantly to simplifying the decryption. But I still couldn’t see anything that looked like a passport number, so back the IATA BCBP web site to dig into the standard.

The first character, “M” means that this is a multi-leg flight, and the next number indicates how many legs, so “M1” means that this is a multi-leg flight consisting of 1 leg. Hmmm, I can’t say  I’m entirely sure about a multi-leg journey which consists of a single leg as a philosophical concept, but I’ll leave that one for the philosophers.

After the flight number FR 225 there is 088, which, according to the standard is the date of the flight, i.e. day 88 which is 29th March. The “Y” refers to the compartment number. Now I’ve never found a Ryanair flight which has an upstairs bar area, or even a little blue curtain between the front and the back, so I guess this is always “Y” for Ryanair. Then we have the seat number – for any Ryainair frequent flyers I’ll just allow a few minutes for the laughter to die down.

Then we’ve got the check-in sequence number, 104. I guess that this means that I was the 104th passenger to check in for this flight. The next “1” is the passenger status, which I think means “adult”.

After that we have OC, which as we all know is 12 in hexadecimal. Which means that the next chunk of information is 12 characters long. All the programmers among you will have immediately spotted the sequence of 20’s in:

202020202020202044454D4F0 10 146 10 0 603 0 603 146

Now all programmers know instinctively that 20 is hexadecimal for 32, which is the ASCII space character, which means there are then 8 spaces, followed by “DEMO”. i.e. 44 is 68 in hexadecimal, which is the ASCII code for D, and 45 represents E, etc. Should we be concerned that the word DEMO appears in here, almost like this is part of a test system which has been released by mistake? So that takes care of the 12 characters,  now it looks like we’re getting close to a passport number! Is this it?

0 10 146 10 0 603 0 603 146

And that’s round about where the wheel fell off!  The last block of boarding pass data is the security section, and it is airline specific – well, it bloody would be, wouldn’t it! There is a group of 9 numbers, and a passport number is 9 digits long, but these aren’t ASCII characters representing numbers, because those only range from 48 to 57 (0 – 9), which means the passport number is encrypted.

Still, if anyone fancies a challenge (believe it or not there is a limit to how much time I will waste on this kind of adventure), it can’t be very complex because it has to be readable by any scanner at the airport, and it can’t use 1-way encryption for the same reason.

Diversion 2 – Internet Browser Caches

Ok, so I have to give up on the boarding pass strategy, but this is where we software developers show that we can waste time on an industrial scale – did I give up? Not likely!

In order to get the boarding pass in the first place I had to check-in on-line. Surely the details of that would still be in my web browser cache? Can’t I just open up the history window of my browser and go back and look at the web page where I originally entered the passport information?

I use Google Chrome, and this is what my cache looked like for the day in question:

I clicked on each of these and got nothing but error messages. So, give up or dig deeper? No contest!

Did you know that you could type chrome:cache as a URL into Google Chrome? This shows you the browser cache in a lot more detail, including HTTP headers and the binary file contents, but still failed to yield a passport number.

Yet more Googling uncovered a tool called the Chrome Cache Viewer, which shows more information about your cache than you could imagine, but did it show my passport number? That was a rhetorical question, by the way –  no, it didn’t!

The Solution

There must be some way that equipped with all of this technology I can find my blasted passport number. Well yes, there is. Peter reminded me that back in 2010  our accountant had photocopied both of our passports. One email – problem solved – Italy here we come 🙂

So was all of this a waste of time? Far from it. I’ve learned some new stuff, I can now use my mobile phone to check bar codes on jars of anchovies, and it’s even looking like I might end up with a driving licence and a passport. Result!