Sunday 29th June, 2008

How does PIN Sentry work?

How does PIN Sentry work?

It looks like a calculator - a basic, harmless device, but can cause arguments similar in scale to bringing the monopoly board out at Christmas. I'm taking about the Barclays PINsentry card reader.

Gone are the days where you can log into your online banking using a few numbers scribbled on a postit note in your top drawer. No, these days you also need an eight digit number generated by putting your bank card into a device that looks a lot like a pocket calculator. You need to generate a new unique number every time you want to access your account.

The reason it causes arguments is that nobody seems to know exactly how it generates the number, yet everybody has an opinion on how it's done. The rubbish I've heard people say never ceases to amuse me,

"It uses radio waves to check your pin with their central computer."

"Each machine has a unique code inside it, linked to the user's account."

"Barclays are using these devices to invade home PCs and takeover the world."

Wrong. Wrong and probably wrong.

As it happens, I don't know how the damn thing works either but I suspect, due to the realms of common sense and the fact that (as Avi pointed out) distributing unique calculators would be extremely difficult to administer, that the eight digit number is based on some very simple variables such as a number stored on your chip and the time.

The leaflet Barclays provided did nothing to tame my curiosity. I glanced through the questions and smiled to myself when I found "How does it work?" only to find that the response was:

"Each time you use the PINsentry card reader, it creates a new, unique eight-digit code that you can use to bank online."

Now I'm no expert on language, but to me that does not answer the question "How does it work?" but rather "What does it do?" Which is exactly what got me thinking in the first place.

So come on my best geeks, how does it come up with the number?

Categories:
2 up, 1 down

35 Comments

Probably uses the last 4 digits of your card & the date or time to calculate a number, which could be matched to the banks online computer which should calculate the same number.

Posted by fluffwitt on Wednesday 31st March, 2010 at 09:47

I reckon there's something it needs stored on each card.

Posted by Sha on Saturday 3rd April, 2010 at 00:35

Funniest of all is how it knows when you get your pin wrong. Now surely that's not stored on the card?!?

Posted by peter on Saturday 1st May, 2010 at 14:56

I reckon the PIN is stored in the chip (hence chip and pin) so it checks your PIN independently of anything else.

You can use any PINSentry not just your own one, so there is nothing unique about each device.

And yes, I reckon some kind of combination of your card number, the date & time and a random algorithm that does it.

Magic!

Posted by Chris on Thursday 20th May, 2010 at 11:26

I too am puzzled. I can only believe it is a combination of aliens from outerspace, the ambient temperature in the room, and the possiblity of England winning the next World Cup. Hmmm...

Posted by Simon on Wednesday 26th May, 2010 at 12:25

It's simple...tiny fairies living inside do everything :P

Posted by Jinx on Tuesday 22nd June, 2010 at 10:27

can't be unique to each pinsentry reader because any pinsentry works with any card.. also, how will it know when you change your pin at the bank? i think it has a small wireless unit that syncs with your details on the internet when you log on.. generates its random numbers to match what the site access is looking for.

Posted by Steve on Thursday 24th June, 2010 at 21:52

It can't be wireless as it would need authentication to access your home internet. I'm going to work on a program to solve this once and for all. Will let you know how it goes!

Posted by Rich on Wednesday 30th June, 2010 at 23:14

This should help you out.

http://www.cl.cam.ac.uk/~sjm217/papers/fc09optimised.pdf

Posted by Peter D on Thursday 15th July, 2010 at 21:23

I think WIFI might be in use here... And yes, to answer earlier comments, the PIN is and always has been stored ON your card, in an 'ultra secure' location. Bit stupid if you ask me, but hey.

Posted by Will on Friday 30th July, 2010 at 13:08

It doesn't use the WIFI, the internet or radio signal, it uses an algorithm. This is a mathematical system to generate a number, based on an input of the last 5 digits of your card number + date + time. The central computer has exactly the same algorithm.

Obviously Barclays keep the details of the system quiet, as to keep it secure.

Posted by Edward on Sunday 1st August, 2010 at 15:48

I don't think the date and time are needed. It's been a while since I used mine, but doesn't the process go something like this?

1) put your card in the reader

2) put in your pin

3) put in a code supplied by the bank on the website

4) get a new code from the reader and put it into the website.

This means that the reader uses your card number + your pin + the code from the website to generate a new number based on a secret algorithm that Barclay also knows. This means that the reader can be very dumb: it doesn't need to know the date, nor does it need any connection to the world other than the card inserted.

The security of the system depends on the secrecy of the algorithm used to turn your card number + the number given from the website into a new number, and thus in principle is very secure. It also of course depends on you not telling/showing people your pin; by far the weakest link in the chip-and-pin system.

Posted by Sam on Sunday 1st August, 2010 at 17:59

http://en.wikipedia.org/wiki/One-time_password

Posted by mike on Tuesday 3rd August, 2010 at 17:24

The point of these things is the number generated is no use to anyone who intercepts it. It only works at the time it is generated. There is a clock in the pinsentry, and it uses the date/time, card number and pin to generate a "perishable" code. The pin is on the card encrypted by a "one way" algorithm. When you enter the pin, it is processed by teh same algorithm and compared to the encrypted pin. The pin is never decrypted.

Posted by jim on Monday 6th September, 2010 at 13:12

I don't believe the date/time is used or relevent, and the codes are not 'perishable', or at least they weren't a year or so ago - I generated a load of codes for use when I was away and might not have my pinsentry with me, and they worked fine over a period of 2 weeks. They are one-time use though, presumably as the site stores the ones you've used before.

Posted by Alan on Tuesday 7th September, 2010 at 13:04

There are one way hash functions such as MD5 and SHA1 that allow you to take any message [A] and easily calculate its hash, [B], but just given some hash [B] it's mathematically very difficult to calculate [A]. These algorithms have been engineered in such a way that 1) It would take hundreds of years using the fastest computer to calculate [A] from [B] and 2) Given any two messages [A1] and [A2], its very very unlikely that they have the same hash.

Therefore the hash [B] of your pin [A] can be safely stored on your card, but not the PIN itself. Even if the card falls into the wrong hands and the criminals are able to extract the hash [B], then it's almost impossible for them to reverse it to get your pin [A].

When you go to the ATM to get money out, the machine asks for your PIN, calculates the hash and then compares it with the hash stored on your card. If the hashes match, then its almost certain that the PIN's match. So, your PIN is not stored on your card, but something mathematically related to is (the hash) is. The same goes for the PINsentry card reader, it doesn't have access to the PIN on your card (the PIN isn't actually on your card), it just compares the hash.

I don't know for certain how the PINsentry works, but if I were designing one, I would do something along these lines. 1) Generate a random four digit number [N], 2) append it to the hash [B] of the PIN, to get [NB] 3) Generate the hash of [NB]. Send both [N] and the hash [NB] over the internet to the bank, where they can use [N] and the [B] they have on record to calculate the hash of [NB] and compare it to the hash of [NB] you sent. If the hashes match, you are who you say you are and you can online bank. The bank will then store the random number you sent, and not allow anyone to log in with it again, in this way if it were intercepted it would be no good.

Posted by toodim on Monday 18th October, 2010 at 22:11

Here's my 2 cents, based on the following experiment:

I used the PINSENTRY to generate a sequence of four numbers, let's call them A, B, C and D. On the first day, I used A, which worked fine. Then on the same day, I signed out, and logged in again using C. Then again on the same day, I repeated the test using B, which failed, as expected. The next day I used D, which succeeded.

I guess that the PINSENTRY and the Barclays computer both compute a predictable series of pseudo-random numbers using the card number (and possibly the PIN) as a "seed." All that needs to be stored at either end is the seed and the point in the series that's been reached so far. This could be as simple as the latest number used, or more probably as its ordinal number, for example the 107th number has been used. This would explain why a) you can generate a whole bunch of numbers to use while travelling without having to lug the PINSENTRY around, and b) why you cannot use skippped numbers, or re-use used numbers.

Thoughts?

Posted by NickT on Sunday 31st October, 2010 at 19:57

I think NickT's experiment clarifies everything!! Funny enough i thought exactly the same and was gonna do the same experiment!!

The numbers are part of a series based on your pin and any number following the one last-used number should work.

Posted by ATee on Monday 1st November, 2010 at 11:50

I think that NickT is almost right, however there are a couple of anomalies that the theory doesn't address.

1) Steve says that any reader works with any card. Therefore the point in the sequence would need to be stored on the card rather than the reader.

2) It would be massively insecure for the bank to keep any record of your pin, anywhere! It would be equally insecure if the card reader could generate the online banking password simply from the card number, as someone could reverse engineer the algorithm and start generating valid online banking numbers, using just the card number.

I think the truth is NickT's method, but secured with the cryptographic techniques I refer to in my previous post.

Posted by toodim on Thursday 4th November, 2010 at 21:10

Yeah but, how does it communicate with the bank without wires and without an authorising code for my network yet still gets the transaction correct?

Posted by kevin on Sunday 5th December, 2010 at 22:01

The way this works is described here:

http://en.wikipedia.org/wiki/Chip_Authentication_Program#Protocol_details

Posted by Dom on Thursday 30th December, 2010 at 02:49

Regarding the reverse-engineering of the algorithm.. this would be equialent to applying a reverse mathematical process, no? You're fine as long as it's a simple operation (+-x/), but you can't do the same with integration and differentiation, as integration produces an unknown constant. I'd guess the algorithm is one involving calculus so is irreversible?

Posted by Evil Teyen on Wednesday 5th January, 2011 at 10:00

You guys are making it a lot more complicated than it actually is. No radio waves, no wireless - just maths.

Like has been said it has an internal clock. Probably in the form a Unix timestamp to make calculations easier. The number changes over time, so obviously time must be a variable involved in the calculations - random numbers would not work because both the server and the device need to reach the same number to allow authentication. Time is a universal variable that can easily be calculated by the server.

Other variables will obviously include the card number, pin etc etc and some sort of other mathematical operations, which will result in an 8 digit number.

Oh and, the card DOES store the PIN (in the chip). But not in plain text of course - or it could just be read by any card reader. When you type in your PIN (in plaintext) it will be encoded, in a way as suggested above by some form of one-way algorithm, the output of which will be stored on the card and then can be used for comparison purposes to determine if the correct pin has been entered.

Simple.

Posted by Ben on Friday 14th January, 2011 at 14:41

This is interesting. I got my Pin sentry reader today and wondered how it worked. I tried my current account card and my barclaycard. I put another card in and it doesn't "recognise" it. Annoying thing is, my Barclaycard was on my last pin try and I got it wrong so will have to contact bank.

Posted by Interested on Sunday 16th January, 2011 at 04:41

I've blogged about exactly how these work - there's no magic involved! See here http://www.matthewedmondson.info/2009/11/why-i-hate-bank-card-readers.html

Posted by Matt on Monday 17th January, 2011 at 11:00

1. Forgot my PIN

2. Requested new PIN which arrived by post in 4 days

3. Put the card into the PINSentry and it accepted the new PIN

My question... how did the PINSentry device correctly authenticate the new pin if the card had not been inserted into an ATM to have the hash in the chip reprogrammed?

Posted by indeed indeed indeed on Thursday 24th March, 2011 at 20:29

sounds to me like the pinsentry system unlocks the secret area that your pin is stored on your chip to verify you enter the same pin that is stored. in other words a hackers dream & a free gateway to a series of codes to unlock clones of stolen cards

Posted by sean on Saturday 2nd April, 2011 at 00:52

go up and read the link by peter D..... nuff said

Posted by Richard devere on Thursday 12th May, 2011 at 19:44

yes, thank god someone's got a brain

Posted by mike on Thursday 22nd September, 2011 at 15:42

OK let me break it down:

1)Every card's chip has a record of its own correct pin.

2)The PINsentry device is not unique, however it has many (possibly millions of) 8 digit numbers which tally with those in barclays database.

3) when you use your card to generate a pin to log in, an algorithm in PINsentry disables that pin from reuse for your login for a long long while (who knows, up to 10yrs) hence inability to reuse the pin if you wrote it down; the same occurs at the barclays end for your account.

thers's no wireless sync. Lol

Posted by Jimbo Geek on Friday 14th October, 2011 at 16:19

Assuming what indeed indeed indeed said is true (and I doubt it can be) the only possibility I can come up with is that his bank pre-stored a "next pin" on his card in the event that they needed to re-issue a pin. The card then accepted this when it was used for the first time and effectively changed it to become the current pin. It seems highly unlikely, but I can't think of any other logical explanation.

Posted by Jellifish on Saturday 22nd October, 2011 at 00:44

BTW has anyone removed the battery from the card reader and then put it back (to effectively reset the date and time) to see if that makes a difference. I'll probably try this soon...

Posted by jellifish on Saturday 22nd October, 2011 at 00:46

You can put your card in several times and instead of using the code it generates write it down. I write sevearal codes down adn therefeore don't have to carry the reader around with me, especially if i am abroad and want to pop into an interenet cafe. Therefore time and date have nothing to do with it and they are all pre-set codes on the chip.

Posted by DJPK on Tuesday 1st November, 2011 at 13:12

Each card has a set number of pre determined codes(millions) and the reader merely gives you one of those codes each time you want to log on. When there aren't any unique codes left, you are issued a couple more million. that's all

Posted by samir on Wednesday 30th November, 2011 at 12:12

Ok guys, here is my explanation of the PIN Sentry mystery!!

I think the PIN Sentry has simply a SIM Card in it and simply connects to the internet with it!

HOW DID I COME UP WITH THIS CONCLUSION?

When you do a transfer online, you specify on your computer the ammount of money you want to transfer, lets say a 4-digit number with 52p, and before actually making the payment you need to confirm it using your PIN Sentry with the SIGN button, and you are asked to put in the PIN Sentry device the amount you are willing to pay. And you dont put a coma or a point to enter the pences of this amount, it already knows!

And if your device knows the amount that you entered online, that means that it is connected to the Barclays servers to know it.... hence the SIM chip (because yeah, it cannot connect to your wifi as it is protected)

It is the same with the Log in code... It is first generated on your PIN Sentry, then sent to Barclays servers, and when u click on the log in button it veryfies the codes match!

What do you think about this explanation?

A good way to find it out is trying to log in an area where you are connected to the internet via cable and have no telephone coverage...!

Cheers!

Posted by Lucas on Thursday 5th January, 2012 at 17:08

Add a comment


HTML tags allowed: <i>, <b> and <a href...
Our naughty word filter will be applied to 12 common swear words.
Your name: (You are not logged in)
Write 6 as a word:

Recommended Book

Straight Out of University

Tom Shock
Tom Shock

0 captions

Archive

2005
May (26)
June (10)
July (13)
August (17)
September (12)
October (8)
November (6)
December (16)

2006
January (11)
February (9)
March (6)
April (10)
May (11)
June (1)
July (7)
August (8)
September (3)
October (5)
November (1)
December (4)

2007
January (3)
February (2)
March (4)
April (5)
May (1)
June (7)
July (7)
August (8)
September (9)
October (1)
November (3)
December (6)

2008
January (2)
February (5)
March (5)
April (10)
May (8)
June (8)
July (12)
August (9)
September (8)
October (4)
November (1)
December (4)

2009
January (7)
February (5)
March (9)
April (5)
May (4)
June (5)
July (3)
August (1)
September (1)
October (1)
December (1)

2010
January (1)
February (12)
March (12)
April (4)
May (1)
June (3)
July (2)
August (7)
September (5)
October (4)
November (7)
December (5)

2011
January (6)
February (2)
March (2)
April (4)
May (2)
June (1)
July (2)
August (2)
September (2)
November (2)

2012
January (4)

James
James

1 caption
Updated 6 weeks ago

Recent queries

Visitors searched the web for:

landlady helps me crossdress & uk
primark lingerie
jellyfish sting is disgusting
the sun captions
spiderman sex
scared? you should be, he's a dentist
genetically engineered jellyfish monkeys
hazards of genetically engineered children
just sha blog's
snake up the nose
twister thong
[...]
sha
sha alternatives
scared? you should be, she's sha crawford!
sha 5 generator
sitting on a park bench looking at watch
most disgusting
helen is an arf monkey
amazing park bench
interchangeable spineless people
pieing
deadliest sea creachers ever
wenger poison west ham spurs
katy k phallic freud
scrapbook caption
poisonous sea creatures
gruesome murders bodies
rubbish presentation
daily mail front page generator
byrchall leapoardess
landlady made me crossdress
caption of broom
sha crawford arf arf
cornish birds
husband anniversary nude blogger
sha nurr blog
kate's belly

Sheep
Sheep

0 captions
Dawlish Swan
Dawlish Swan

0 captions
Full
Full

0 captions