Authentication factors (something you know, have, are) in Cybersecurity - Time & Space Complexity
Start learning this pattern below
Jump into concepts and practice - no test required
We want to understand how the time needed to verify a user's identity changes as the number of authentication factors grows.
How does adding more factors affect the time it takes to check them all?
Analyze the time complexity of the following authentication check process.
function authenticate(userInput, factors) {
for (let factor of factors) {
if (!verify(factor, userInput[factor.type])) {
return false;
}
}
return true;
}
// verify() checks each factor like password, token, or biometric
This code checks each authentication factor one by one to confirm the user's identity.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Loop over each authentication factor to verify it.
- How many times: Once for each factor in the list.
As the number of factors increases, the time to check them grows in a straight line.
| Input Size (n) | Approx. Operations |
|---|---|
| 1 | 1 verification |
| 3 | 3 verifications |
| 5 | 5 verifications |
Pattern observation: Doubling the number of factors roughly doubles the work needed.
Time Complexity: O(n)
This means the time to authenticate grows directly with the number of factors checked.
[X] Wrong: "Adding more factors won't affect authentication time much because each check is fast."
[OK] Correct: Even if each check is quick, doing many checks one after another adds up, increasing total time linearly.
Understanding how authentication time grows helps you design secure systems that stay efficient as more factors are added.
"What if the verification process for each factor ran in parallel instead of one after another? How would the time complexity change?"
Practice
something you know in authentication factors?Solution
Step 1: Understand the category 'something you know'
This factor refers to information only the user knows, like a password or PIN.Step 2: Match options to categories
A password is knowledge-based; a security token and smartphone app are 'something you have'; fingerprint is 'something you are'.Final Answer:
A password -> Option BQuick Check:
Knowledge factor = Password [OK]
- Confusing biometric (fingerprint) with knowledge
- Thinking a device (token) is knowledge
- Mixing possession with knowledge
something you have as an authentication factor?Solution
Step 1: Define 'something you have'
This factor means a physical object you possess, like a hardware key or phone.Step 2: Identify the correct option
A hardware security key is a physical device you have; birthdate and secret answers are knowledge; voice is biometric.Final Answer:
A hardware security key -> Option AQuick Check:
Possession factor = Hardware key [OK]
- Choosing personal info as possession
- Confusing biometrics with possession
- Selecting knowledge-based answers
user_input = '1234'
stored_pin = '1234'
if user_input == stored_pin:
print('Access granted')
else:
print('Access denied')Which authentication factor does this code represent?
Solution
Step 1: Analyze the code's authentication method
The code compares a user input PIN to a stored PIN, verifying knowledge of a secret.Step 2: Match the factor type
Since it checks a secret code, it is 'something you know'.Final Answer:
Something you know -> Option AQuick Check:
PIN check = Knowledge factor [OK]
- Thinking code checks possession
- Confusing biometrics with PIN
- Selecting 'something you do' which is not standard
Solution
Step 1: Understand fingerprint scanning as a biometric factor
Fingerprint is 'something you are', relying on hardware to read biometrics accurately.Step 2: Identify cause of denial
If authorized users are denied, hardware malfunction or sensor errors are likely causes, not user knowledge or multi-factor setup.Final Answer:
The fingerprint sensor hardware is malfunctioning -> Option DQuick Check:
Biometric errors usually mean hardware issues [OK]
- Confusing biometrics with knowledge factors
- Blaming password issues for fingerprint errors
- Assuming multi-factor causes denial
Solution
Step 1: Identify each factor type
Password is 'something you know'; fingerprint is 'something you are' (biometric).Step 2: Understand multi-factor authentication
Using two different factor types together is multi-factor authentication, improving security.Final Answer:
It uses multi-factor authentication combining knowledge and biometrics -> Option CQuick Check:
Two different factor types = Multi-factor [OK]
- Thinking password and fingerprint are same factor
- Confusing multi-factor with single-factor
- Assuming both are possession factors
