PanelSimulator Academy

Access Control, lesson 2 of 14

Credentials: cards, fobs and phones

Lesson 1 showed five parts working together at a door. This lesson starts with the one in your hand. A credential is a number you carry: here you will see where that number lives, how it crosses the gap to the reader with no battery and no contact, and why some cards are far easier to copy than others.

About 14 minutes. Read lesson 1 first.

Watch the gap between card and reader

Pick a kind of card, then play or step through the conversation.

Reader 1 0 1 1 0 chip Card, seen from inside

The everyday picture

Think of a coat check. You hand over your coat and get a small ticket with a number on it. The ticket does not say your name or describe your coat. The number only means something because the attendant has a book that says which coat goes with it.

A credential works the same way. It carries a number. The controller's list says who that number belongs to and which doors they may use. Lose the ticket and the attendant can cross that number out of the book.

There is one catch with coat tickets. If the ticket is plain paper with a number written on it, anyone who sees it can write the same number on another piece of paper. That weakness is the main difference between old cards and new ones.

Three kinds of credential

Cards, key fobs, stickers and wristbands are only different shapes. What matters is the technology inside. There are three families in use today.

  • Proximity card The oldest kind still in wide use. It works at a radio frequency of 125 kHz. It sends the same number, unprotected, to any reader that powers it. Hard to copy
  • Smart card Works at 13.56 MHz and holds a secret key in its chip. The card and the reader prove themselves to each other before any number is sent. Hard to copy
  • Mobile credential The same idea as a smart card, stored in a phone or watch and sent by NFC or Bluetooth. It is issued and canceled over the internet, with nothing to hand out. Hard to copy
ProximitySmart cardMobile
Typical reading distanceA few inchesAn inch or twoA tap, or several feet with Bluetooth
Protects the numberNoYes, with a secret keyYes, with a secret key
Needs a batteryNoNoThe phone's own
Cost per personLowestA little moreOften a yearly fee
Where you see itOlder buildingsMost new installationsOffices and apartments

How a card works with no battery

The reader constantly sends out a small radio field. Inside the card is a coil of thin wire. When the coil enters the field, the field pushes a tiny electric current through it, enough to wake the chip. The chip answers by drawing a little more or a little less of that energy in a pattern, and the reader notices the pattern. That pattern is the number.

This is why a card never runs flat, and why it only works close to the reader. Go back to the diagram above and compare the two kinds of card.

Check yourself

Someone loses their card on the bus. What has to change?

What is in the number?

The number on a card is sent as a row of ones and zeros called bits. The most common layout is 26 bits long, and almost every system understands it. It has four parts:

  • A facility code, from 0 to 255. Everyone at one site usually shares it.
  • A card number, from 0 to 65,535. This is the part that is different for each person.
  • Two parity bits, one at each end. They let the reader notice a bad read.

Build a card number

Change the two numbers and watch the bits. Then click any bit to damage it, as radio noise might.

Parity bitFacility code, 8 bitsCard number, 16 bits

How parity catches a bad read

The first parity bit looks at the first half of the number and is set so that the count of ones in that half comes out even. The last parity bit does the same for the second half, but makes the count odd. If one bit is damaged on the way, a count comes out wrong and the reader throws the read away.

Why 26 bits is not a secret

The 26-bit layout is published and anyone can order cards in it. With only 255 facility codes and 65,535 card numbers, two different buildings can end up with identical cards. Longer layouts exist to avoid that. But remember what the layout is: a way of writing the number down. It does nothing to hide it. Protection comes from the kind of card.

Have, know, are

A card proves only that someone is holding the card. Security people sort proof of identity into three kinds:

  • Something you have. A card, a fob, a phone.
  • Something you know. A PIN typed on a keypad.
  • Something you are. A fingerprint or a face. This is called a biometric.

Asking for two kinds at once is called two-factor access. A found card is useless without the PIN, and a guessed PIN is useless without the card. It is slower for every person at every entry, so sites use it on the few doors that deserve it, such as a server room or a pharmacy.

Three examples

Simple: a new twelve-person office

The owner asks for the cheapest cards. The price difference between proximity and smart cards for twelve people is small, and the readers cost about the same. Smart cards are the sensible choice: the same convenience, and a card that cannot be copied at a key-cutting kiosk.

Medium: moving a building off old cards

A 400-person building wants to leave proximity cards behind. Replacing every reader and every card in one weekend is risky. Instead the installer fits readers that understand both kinds. People keep using their old cards while new ones are handed out department by department. When the last old card is collected, the readers are set to refuse proximity cards altogether.

The last step is the one that gets forgotten. Until the old technology is switched off at the reader, the building is only as safe as its oldest card.

Advanced: two people, one number

A school orders a second box of 26-bit cards from a different supplier. Months later a teacher's card opens the boiler room, which it never should. Both boxes used facility code 12, and the card numbers overlapped. The system saw the teacher's card as the caretaker's.

The fix is record keeping. Write down the facility code and the range of numbers in every box you buy, and give the next supplier the starting number for the next box.

From the field

  • Find out what the site already has before quoting. Tap an existing card on a test reader. Guessing the card type from its appearance goes wrong often.
  • Keep a card log. Format, facility code and number range for every order.
  • Ask who owns the keys. With smart cards, someone holds the secret key that every card and reader shares. If only one supplier has it, the site can only ever buy from that supplier.
  • Plan for the forgotten phone. Mobile credentials are convenient until a battery dies at the parking lot gate. Decide in advance how that person gets in.
  • Switch off lost cards the same day. A list that is not kept up to date is the most common weakness on real sites.

Common mistakes

  • Thinking the card stores a name or a list of doors. It stores a number.
  • Thinking a longer number means a safer card. Length stops duplicates. It does not stop copying.
  • Leaving readers set to accept old cards after everyone has a new one.
  • Ordering cards without telling the supplier which numbers are already in use.
  • Using two-factor access on every door, so that people start propping doors open.

Summary

  • A credential carries a number. The list gives the number its meaning.
  • Cards have no battery. The reader's radio field powers them.
  • Proximity cards send their number unprotected. Smart cards and phones prove themselves with a secret key first.
  • The common 26-bit layout holds a facility code, a card number and two parity bits.
  • Have, know, are: combining two makes a door much harder to get through, and slower to use.

Exercises

Answer each one yourself first, then open the answer.

Exercise 1. In the 26-bit layout, how many different card numbers can one facility code have?

Show answer
65,536. The card number is 16 bits long, which gives every value from 0 to 65,535.

Exercise 2. In the tool above, set facility code 1 and card number 1. How many ones are in the row, and why is it not two?

Show answer
Three. The facility code and the card number each contribute a single one. The first half now has one 1, so the first parity bit becomes 1 to make that count even. The second half already has one 1, which is odd, so the last parity bit stays 0.

Exercise 3. A site has smart cards, but its readers still accept proximity cards too. A manager says the site is now protected against copied cards. Is that right?

Show answer
No. Any old proximity card that is still active on the list can be copied and will still open doors. The protection only arrives when the old cards are removed from the list and the readers stop accepting that technology.

Exercise 4 (think, don't memorize). A laboratory wants card plus fingerprint on its front entrance, which 300 people use each morning. What would you ask before agreeing?

Show answer
Ask what the front entrance is protecting, and what sits behind it. Two-factor at a busy entrance creates a line, and lines lead to people holding the door for each other. A common answer is a single factor at the entrance and two factors on the few inner rooms that hold what really matters.