Authentication: What You Know, Have and Are

Security's Two Questions

Security boils down to two questions.
• Who are you?
• What should you have access to?
Access should be given to authorized people and refused to the wrong people.
To differentiate between authorized and unauthorized personnel we use authentication, the process by which the computer understands who it is interacting with. Authentication measures protect devices and information from unauthorized access, and examples of them include strong passwords and multifactor authentication.

Multifactor Authentication

Multifactor authentication is a method of computer access control in which a user is only granted access after successfully presenting several separate pieces of evidence to an authentication mechanism, typically in at least two of the following categories.
Read the end of that definition again. At least two of the CATEGORIES. Two pieces of evidence from the same category are not multifactor authentication, however separate they feel.
Multifactor authentication requires at least two steps to unlock protected information. Each step adds a new layer of security that must be broken to gain unauthorized access. A stolen password on its own no longer opens the account.
CategoryBased onExample
Knowledge, what you knowA secret known only to the real user and the computerA username and password
Possession, what you havePossession of a secret token that only the real user hasA physical key and lock
Inherence, what you areYou. You authenticate by presenting yourself to the computerFingerprint readers and iris scanners
Three categories of evidence, in three panels. Knowledge, what you know: a password field of stars; password, PIN. Possession, what you have: a key; key, phone, security key. Inherence, what you are: a fingerprint; fingerprint, iris. Below, two sign-ins, each with two steps. Password, then a code from a security key: Knowledge plus Possession equals 2 categories: multifactor. Password, then a PIN: Knowledge plus Knowledge equals 1 category, twice: not multifactor.

What You Know

A username and password is easy to implement, and can be compromised if hackers can guess or find out the password. Some are easy for humans to figure out, such as 1234 or 1111.
Computers can try to brute force all password combinations. A 4-digit ATM PIN has only 10,000 combinations, from 0000 to 9999.
Many websites now require upper and lower case, numbers and special symbols, to explode the number of combinations. An 8-digit PIN has 100,000,000 combinations, since each of the eight positions holds one of ten digits.
How many passwords, and how long to try them all. Bar length is the number of digits in the count. 4-digit PIN: 10,000, under a second. 8-digit PIN: 100,000,000, under a second. 8 characters, 62 choices each: about 2.2 x 10^14, about 2.5 days. 12 characters, 62 choices each: about 3.2 x 10^21, about 100,000 years. 16 characters, 62 choices each: about 4.8 x 10^28, about 1.5 x 10^12 years. Times assume a billion guesses every second.
The program below counts the 8-character passwords made from 62 characters, one position at a time. Then it works out how long trying them all takes at a billion guesses a second. Run it, then make each change below and run it again. Press Reset before each change, so that each one starts from the original program.
• Change alphabet to 95, every printable symbol on the keyboard.
• Change length to 9, and compare its count with the 6,634 trillion for 95 symbols in the example.
• Change length to 12. From 9 characters on, the counts pass 9007199254740991, the largest whole number JavaScript is sure to hold exactly. From 10 on, the last printed digits are rounded. In JavaScript, 3.2e+21 means 3.2 times 10 to the power 21.
let alphabet = 62;
let length = 8;
let guessesPerSecond = 1000000000;

let count = 1;
for (let position = 1; position <= length; position++) {
  count = count * alphabet;
  console.log(count, "passwords of length", position);
}

let seconds = Math.floor(count / guessesPerSecond);
let days = Math.floor(seconds / (60 * 60 * 24));
console.log("Whole days to try them all:", days);
console.log("Whole years to try them all:", Math.floor(days / 365));
Output
Press Run to see what this program prints.

Note: This IDE is for experimenting with the code in this lesson. Your changes are not saved, and refreshing the page puts back the original lesson code.

What You Have

What you have is based on the possession of a secret token that only the real user has, such as a physical key and lock.
• You can open the door if you have the key.
• It avoids the problem of being guessable.
• It is harder for a remote attacker.
• But it can be compromised if the hacker is close by: keys can be copied, phones can be stolen, and even locks can be picked.
A small black USB security key with a round gold touch pad, lying on a white surface.
A USB security key, something you have. Signing in needs the key, so a stolen password alone is not enough. Photo: Tony Webster, CC BY 2.0, via Wikimedia Commons.

What You Are

What you are is based on YOU. You authenticate by presenting yourself to the computer, through biometric authenticators such as fingerprint readers and iris scanners. These are secure but can be expensive, and the data coming off the sensors varies over time.
What you know and what you have are deterministic, meaning always predicting the same output from a given input. If you know the password or have the key you are granted access 100 percent of the time, and if you do not, you are granted access 0 percent of the time.
Biometric authenticators are probabilistic, meaning an element of chance is involved and different output may come from the same input.
Deterministic: what you know, what you haveProbabilistic: what you are
Same input, same answer?AlwaysNot necessarily
Can it refuse the real user?NoYes, if lighting is bad or you are wearing glasses
Can it admit the wrong person?Not without the secret or the tokenYes, it can recognise someone who is not you, such as your twin
Can it be reset after a compromise?Yes, change the password or the lockNo