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?
2 up, 1 down

35 Comments

I reckon there's something it needs stored on each card.
Funniest of all is how it knows when you get your pin wrong. Now surely that's not stored on the card?!?
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!
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...
It's simple...tiny fairies living inside do everything :P
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.
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!
This should help you out.
http://www.cl.cam.ac.uk/~sjm217/papers/fc09optimised.pdf
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.
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.

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.
http://en.wikipedia.org/wiki/One-time_password
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.
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.
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.
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?
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.
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.
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?
The way this works is described here:
http://en.wikipedia.org/wiki/Chip_Authentication_Program#Protocol_details
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?
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.
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.
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
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?
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
go up and read the link by peter D..... nuff said
yes, thank god someone's got a brain
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
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.
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...
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.
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
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!
Add a comment
Recommended Book

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)
Recent queries
Visitors searched the web for:
Location: Devon, UK
Recent Blog Comments
Recent Photos Comments
Tags
culture
art (13)
modern (2)
photography (9)
thought-provoking (1)
fashion (43)
alternative (4)
beauty (17)
hair (8)
clothing (10)
casual wear (5)
footwear (2)
hats (3)
undies (4)
home (4)
tattoos (2)
gay issues (8)
gender (3)
lifestyles (1)
entertainment
books (5)
celebrities (24)
actors (6)
darko (7)
musicians (4)
podcasters (2)
royals (2)
sports people (4)
footballers (1)
rowers (3)
undeserving (1)
writers (2)
film (18)
magazines (5)
music (6)
newspapers (7)
podcasts (1)
television (12)
theatre (9)
environment
animals & plants (28)
animals (27)
birds (7)
swans (4)
fish (4)
insects (3)
jellies (1)
pets (6)
reptiles (1)
plants (2)
disasters (2)
droughts (1)
floods (1)
green issues (6)
weather (4)
evil
baddies (33)
gooners (5)
hens and stags (1)
invertebrates (2)
lawyers (4)
mad brides (1)
moron week (4)
phone networks (1)
photo booths (1)
scams (3)
seagulls (1)
witches (8)
crime (8)
assault (1)
murder (4)
of fish (2)
terrorism (2)
theft (3)
of biscuits (1)
food & drink
drink (5)
alcohol (1)
ribena (3)
tea (1)
food (15)
chocolate (5)
games & toys
challenges (6)
competitions (29)
fantasy football 2010 (20)
games (7)
quizzes (9)
toys (9)
health & safety
health (23)
safety (8)
humour
accidental (14)
black (2)
geek (8)
lame (3)
parody (7)
satire (6)
language
cornish (2)
made up words (2)
naughty words (2)
poetry (4)
the brain (1)
translations (1)
letters
private (2)
public (2)
occasions
april fools day (0)
birthdays (6)
births (0)
christmas (5)
deaths (1)
new year (2)
valentine's day (2)
weddings (5)
royal (2)
places
cornwall (9)
devon (7)
dawlish (2)
exeter (4)
plymouth (1)
oxford (41)
catz (19)
catz mcr (12)
roxburgh (3)
religion & politics
philosophy (1)
politics (22)
causes (22)
anti-discrimination (2)
glamorising helmets (2)
glamorising ribena (3)
help the homeless (1)
organ donation (1)
sponsor a bipolar (1)
world peace (2)
religion (3)
science
bad science (10)
suspect products (6)
experiments (9)
psychology (4)
sex, nudity and romance
nudity (5)
romance (10)
dating (10)
networking (0)
sex (4)
spooky stuff
coincidences (5)
dreams (1)
ghosts (1)
goths (3)
mysteries (4)
psychic abilities (2)
superstitions (1)
zombies (1)
sport
cycling (7)
football (20)
frozen (2)
swimming (10)
yoga (2)
tales
happy endings (5)
sad sad tales of woe (17)
technology
gadgets (2)
phones (1)
pin sentry (1)
web 2.0 (61)
advertising (6)
blogging (31)
meet other bloggers (2)
memes (3)
this blog (17)
keywords (8)
new features (7)
tips (5)
censorship (1)
gimmicks (1)
knowledge (1)
photo resources (2)
privacy (1)
programming (3)
search engines (5)
social networking (14)
facebook (10)
twitter (1)
spam (2)
traffic monitoring (1)
transport
buses (4)
cars (2)
dr martens (1)
planes (1)
taxis (0)
trains (2)
writing projects
novels (1)
screenplays (3)
short stories (2)
stage plays (1)
web (3)
Message Sha
Links
- The Caption Game
- The Coffee House Players
- Indie Books Board
- Word Central
- Tabloid Front Page Generator
- It's Always Bloody Greensleeves
- My Flickr Albums
- Sponsor a Manic Depressive
- Kait at Catz
- Storyline Generator
- Poems by Tommy Herbert
- Herbert Fortnightly
- Pancadaonervoso
- ponderingmind.org
- Answer Me This Podcast
- Something to say
- Beetroot Soup
- My Google Profile








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.