Bird
Raised Fist0
Cybersecurityknowledge~5 mins

Authentication factors (something you know, have, are) in Cybersecurity - Time & Space Complexity

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Time Complexity: Authentication factors (something you know, have, are)
O(n)
Understanding Time Complexity

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?

Scenario Under Consideration

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 Repeating Operations

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.
How Execution Grows With Input

As the number of factors increases, the time to check them grows in a straight line.

Input Size (n)Approx. Operations
11 verification
33 verifications
55 verifications

Pattern observation: Doubling the number of factors roughly doubles the work needed.

Final Time Complexity

Time Complexity: O(n)

This means the time to authenticate grows directly with the number of factors checked.

Common Mistake

[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.

Interview Connect

Understanding how authentication time grows helps you design secure systems that stay efficient as more factors are added.

Self-Check

"What if the verification process for each factor ran in parallel instead of one after another? How would the time complexity change?"

Practice

(1/5)
1. Which of the following is an example of something you know in authentication factors?
easy
A. A fingerprint
B. A password
C. A security token
D. A smartphone app

Solution

  1. Step 1: Understand the category 'something you know'

    This factor refers to information only the user knows, like a password or PIN.
  2. 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'.
  3. Final Answer:

    A password -> Option B
  4. Quick Check:

    Knowledge factor = Password [OK]
Hint: Passwords are always 'something you know' [OK]
Common Mistakes:
  • Confusing biometric (fingerprint) with knowledge
  • Thinking a device (token) is knowledge
  • Mixing possession with knowledge
2. Which of the following correctly represents something you have as an authentication factor?
easy
A. A hardware security key
B. A secret question answer
C. Your voice
D. Your birthdate

Solution

  1. Step 1: Define 'something you have'

    This factor means a physical object you possess, like a hardware key or phone.
  2. 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.
  3. Final Answer:

    A hardware security key -> Option A
  4. Quick Check:

    Possession factor = Hardware key [OK]
Hint: Physical devices are 'something you have' [OK]
Common Mistakes:
  • Choosing personal info as possession
  • Confusing biometrics with possession
  • Selecting knowledge-based answers
3. Consider this code snippet representing a simple authentication check:
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?
medium
A. Something you know
B. Something you have
C. Something you are
D. Something you do

Solution

  1. Step 1: Analyze the code's authentication method

    The code compares a user input PIN to a stored PIN, verifying knowledge of a secret.
  2. Step 2: Match the factor type

    Since it checks a secret code, it is 'something you know'.
  3. Final Answer:

    Something you know -> Option A
  4. Quick Check:

    PIN check = Knowledge factor [OK]
Hint: PIN or password checks are 'something you know' [OK]
Common Mistakes:
  • Thinking code checks possession
  • Confusing biometrics with PIN
  • Selecting 'something you do' which is not standard
4. A system uses fingerprint scanning for login but sometimes denies access even for authorized users. What is the most likely cause?
medium
A. The fingerprint scanner is a 'something you know' factor
B. The system uses multi-factor authentication
C. Users forgot their passwords
D. The fingerprint sensor hardware is malfunctioning

Solution

  1. Step 1: Understand fingerprint scanning as a biometric factor

    Fingerprint is 'something you are', relying on hardware to read biometrics accurately.
  2. 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.
  3. Final Answer:

    The fingerprint sensor hardware is malfunctioning -> Option D
  4. Quick Check:

    Biometric errors usually mean hardware issues [OK]
Hint: Biometric denial often means hardware problem [OK]
Common Mistakes:
  • Confusing biometrics with knowledge factors
  • Blaming password issues for fingerprint errors
  • Assuming multi-factor causes denial
5. A company wants to improve security by requiring two authentication factors: a password and a fingerprint scan. Which statement best describes this setup?
hard
A. It uses only 'something you have' factors
B. It uses two 'something you know' factors
C. It uses multi-factor authentication combining knowledge and biometrics
D. It uses single-factor authentication

Solution

  1. Step 1: Identify each factor type

    Password is 'something you know'; fingerprint is 'something you are' (biometric).
  2. Step 2: Understand multi-factor authentication

    Using two different factor types together is multi-factor authentication, improving security.
  3. Final Answer:

    It uses multi-factor authentication combining knowledge and biometrics -> Option C
  4. Quick Check:

    Two different factor types = Multi-factor [OK]
Hint: Different factor types mean multi-factor authentication [OK]
Common Mistakes:
  • Thinking password and fingerprint are same factor
  • Confusing multi-factor with single-factor
  • Assuming both are possession factors