Sub topic 2
Authentication factors: something you know, have and are
This chapter assumes you have used a centralized exchange account, know what a password and two-factor authentication (2FA) are, and can change account settings. It gives you the vocabulary for the rest of the tutorial: what a factor is, how the categories differ, and why the category of a method does not tell you how strong it is.
What authentication has to prove
Authentication is the step where a system checks that the person at the keyboard controls the account. It is separate from two related steps:
- Identification is claiming an identity, such as typing
[email protected]. - Authorization is deciding what an identified user may do, such as withdrawing funds.
An exchange account takeover is an authentication failure. The attacker claims to be Alice, and the exchange accepts the proof offered. Everything in this tutorial is about making that proof harder to steal, copy or trick out of you.
The three classic factors
A factor is a category of evidence. The standard model has three.
| Factor | Question it answers | Exchange examples | Typical weakness |
|---|---|---|---|
| Knowledge | What do you know? | Password, PIN, security question answer | Can be guessed, reused, leaked or typed into a fake site |
| Possession | What do you have? | Phone with an authenticator app, hardware security key, SIM card | Can be stolen, cloned or diverted |
| Inherence | What are you? | Fingerprint, face scan | Cannot be changed if leaked, and is not secret |
Some descriptions add a fourth idea, such as location or behavior. Treat those as risk signals rather than factors. An exchange may ask for extra proof when you log in from a new country, but a location cannot be presented as a credential.
Multi-factor means different categories
Multi-factor authentication (MFA) requires evidence from at least two different categories. Two items from the same category do not qualify.
- A password plus a security question is two knowledge items. An attacker who phishes you gets both.
- A password plus an email code is weaker than it looks. If the same password protects your email account, one stolen secret opens both.
- A password plus a code from an authenticator app is true MFA. The attacker needs something you know and something you have.
This small program makes the rule concrete:
from enum import Enum
class Category(Enum):
KNOW = "know"
HAVE = "have"
ARE = "are"
METHODS = {
"password": Category.KNOW,
"pin": Category.KNOW,
"totp_app": Category.HAVE,
"security_key": Category.HAVE,
"sms_code": Category.HAVE,
"fingerprint": Category.ARE,
}
def is_multi_factor(methods):
categories = {METHODS[m] for m in methods}
return len(categories) >= 2
print(is_multi_factor(["password", "pin"])) # False
print(is_multi_factor(["password", "totp_app"])) # TrueThe code only counts categories. It cannot tell you whether a "have" is strong, which is the next topic.
Category is not strength
The three-factor model says what kind of evidence you give. It says nothing about how an attacker can get that evidence. Two methods in the same category can differ enormously.
Consider possession:
- An SMS code counts as "something you have" because it arrives on your phone. But the real thing the exchange trusts is your phone number, and an attacker can move a number to a new SIM through your carrier. The "have" can be hijacked without touching your phone.
- A TOTP secret in an authenticator app is a possession, but it is a shared secret. The exchange stores a copy, and you saw the secret as a QR code during enrollment. Anyone who sees that QR code or the exchange's database can generate your codes.
- A passkey private key is a possession that never leaves your device or your passkey provider. The exchange stores only the public half, so a database leak gives an attacker nothing to sign in with.
So you need extra questions to compare methods. These four are the ones we will use:
- Can the credential be phished? If you can be tricked into typing or approving it on a fake site, it is phishable.
- Can it be replayed? A value that works if an attacker captures it and uses it within seconds or minutes is replayable.
- Does the server hold a secret that, if leaked, lets an attacker impersonate you?
- Can it be diverted or cloned without taking your device?
| Method | Factor category | Phishable | Server-side secret that enables impersonation | Diversion or clone risk |
|---|---|---|---|---|
| Password | Know | Yes | Hash only, but guessable if weak | Reuse across sites |
| SMS code | Have (nominally) | Yes | No | SIM swap, number porting |
| Authenticator app (TOTP) | Have | Yes, in real time | Yes, the shared secret | Secret exposed at enrollment or in backups |
| Passkey | Have, plus know or are for unlock | No, bound to the site | No, public key only | Depends on sync and recovery |
| Hardware security key | Have, plus a PIN or touch | No, bound to the site | No, public key only | Loss of the key |
Later chapters explain each row. For now, notice the pattern: moving down the table removes whole attack classes, not just one.
Biometrics: what "something you are" really does
Biometrics are often misunderstood in this context, so three points matter.
- A fingerprint or face is not a secret. You leave fingerprints on glasses and your face is in photos. Biometrics work as a convenient local check, not as a password.
- You cannot rotate a biometric. If a password leaks, you change it. If a biometric template leaks, you cannot.
- With passkeys, the biometric stays on your device. It unlocks the private key locally, and the exchange never receives your fingerprint or face. The exchange only sees a signature. This is why the code example in the topic uses
userVerification: "required": it asks the device to confirm that the person present is the owner, using a biometric or a device PIN.
So a passkey sign-in with a fingerprint combines possession (the device holds the key) and inherence (you unlock it) in one gesture. The exchange cannot independently check the second part, but it can require that the device performed it.
The flow you are designing
A login with MFA is a sequence of checks, and any step may be where an attacker succeeds or fails.
Notice that the diagram ends at a session. After login the exchange gives your browser a session token, and an attacker who steals that token skips both factors. A later chapter covers sessions. The point here is that factors protect the moment of login, not everything that follows.
Where exchanges apply factors
A strong login does not help if other paths are weaker. Check each of these on your own exchange:
- Login. Is a second factor mandatory, or optional and off by default?
- Withdrawals. Some exchanges ask for a second factor again for each withdrawal, and some only at login. Re-checking at withdrawal limits damage from a stolen session.
- Security changes. Changing the password, 2FA method or withdrawal address should require fresh proof of both factors.
- API keys. These are a separate credential, usually just a string. They carry no second factor, so they need their own limits.
- Account recovery. This is the path that matters most. If you can recover an account with only an email link or a support ticket, an attacker will skip your strong factors and use recovery instead.
An account is only as strong as its weakest allowed path. Strengthening the front door while leaving a side door open gives a false sense of safety.
Common mistakes
- Treating email codes as a strong second factor. Email is a possession in name, but it is often protected by a weaker password than your exchange account, and it is the usual recovery channel.
- Counting "security questions" as a factor. They are knowledge, often guessable from social media, and best avoided or filled with random answers stored in a password manager.
- Keeping the password and the TOTP secret in the same password manager. This is a trade-off, not an error. It makes login convenient, but a compromise of that vault gives an attacker both categories at once, so the two factors collapse into one.
- Leaving SMS enabled as a fallback after enrolling an authenticator app or passkey. An attacker will pick the weakest enabled method. Disable weaker methods once stronger ones work.
- Assuming MFA stops phishing. Authenticator codes and SMS codes can be relayed in real time to the real site by a phishing page. Only origin-bound credentials such as passkeys resist this.
Summary of the working model
Authentication evidence falls into three categories: know, have and are. MFA needs two different categories. Within a category, strength depends on whether the credential can be phished, replayed, diverted or exposed by a server leak. The best choice is therefore a method that removes those risks, and you must also close any weaker path, such as SMS or email-only recovery, that bypasses it.
Exercise
An exchange offers a password plus a secret question as its "two-step" login. Is this multi-factor authentication? Explain, and name one change that would make it multi-factor.
Show answer
No. Both items are knowledge factors, so a phishing page or a data breach can collect both at once. Replacing the secret question with an authenticator app code or a passkey adds a possession factor, which makes it multi-factor.
Exercise
A user enrolls a passkey on their exchange account but leaves SMS codes enabled as a fallback for login and recovery. Which attack still works against this account, and why does the passkey not prevent it?
Show answer
A SIM swap. The attacker ports the victim's number to a SIM they control, requests an SMS code and uses it to log in or recover the account. The passkey is never asked for, because the exchange accepts the weaker method. The fix is to disable SMS as a login or recovery method once the passkey works.