Password Policies and Multi-Factor Authentication
Understand strong password requirements, MFA factors (something you know/have/are), and why layering factors dramatically reduces account compromise risk.
Password Policies and Multi-Factor Authentication is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Passwords: The Weakest Link
Passwords remain the most common authentication mechanism despite being the most frequently compromised. Attackers steal passwords through phishing, credential stuffing (reusing breached credentials), brute-force attacks, and keyloggers. Even a 'strong' password provides limited protection if an attacker can silently capture it. Password policies set minimum requirements for complexity and rotation to reduce risk, but the most impactful security improvement is adding a second factor — because knowing the password is no longer sufficient to gain access.
Password Complexity Requirements
Effective password complexity policies define minimum standards that make passwords harder to crack. Traditional requirements include: minimum length (12-16 characters minimum; length matters more than complexity), required character types (uppercase, lowercase, numbers, symbols), prohibition of common passwords (password dictionaries), and prohibition of the username or organization name within the password. NIST SP 800-63B guidelines updated in 2017 recommend prioritizing length over arbitrary complexity rules and checking passwords against breached credential databases rather than requiring frequent rotation.
# Check if a password appears in known breach databases
# NIST recommends this approach vs forced periodic rotation
# Example: Using Have I Been Pwned (HIBP) API
# Hash the password first (k-anonymity model - sends only first 5 chars of SHA-1)
echo -n 'mysecretpassword' | sha1sum
# Returns: e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4 -
# Send first 5 chars to HIBP API:
# GET https://api.pwnedpasswords.com/range/E5E9F
# Response includes suffix of any matching hashes
# If found: this password is compromised - reject itNIST SP 800-63B Modern Password Guidance
NIST SP 800-63B (Digital Identity Guidelines) significantly revised password best practices. Key updates: don't require periodic rotation unless there is evidence of compromise — forced rotation leads users to make predictable changes (Password1! → Password2!); do check against breach databases at creation and allow users to see their password while typing; allow long passphrases up to 64 characters; eliminate arbitrary complexity rules that produce predictable patterns; and implement account lockout or throttling to prevent brute-force attacks rather than relying solely on complexity.
The Three Authentication Factors
Authentication relies on one or more of three factor types. Something you know (knowledge factor): passwords, PINs, security questions, passphrases. Something you have (possession factor): physical token, smartphone with authenticator app, smart card, hardware key (YubiKey). Something you are (inherence factor): fingerprint, retina scan, face recognition, voice pattern, behavioral biometrics. A fourth category — somewhere you are (location) — is sometimes added. Using a factor from two or more categories is multi-factor authentication (MFA). Two factors from the same category (like two passwords) is not MFA.
Why MFA Is So Effective
Multi-factor authentication (MFA) is one of the most impactful security controls available. Microsoft research indicates MFA blocks 99.9% of account compromise attacks. The reason: phishing or credential theft gives an attacker 'something you know' (password), but they typically cannot also obtain the second factor (a smartphone one-time code or hardware key). Even if a user's password is published in a breach database, the account remains protected if MFA is enabled. Organizations that have implemented MFA rarely appear in breach reports involving credential-based account takeover.
SMS OTP and Its Weaknesses
SMS One-Time Passwords (OTP) are the most widely deployed MFA method — a 6-digit code sent by text message. They are better than no MFA, but have documented weaknesses. SIM swapping attacks: attackers impersonate the victim to the mobile carrier and transfer the phone number to their SIM, intercepting future OTP codes. SS7 protocol vulnerabilities: the telephone network's signaling protocol has known flaws that allow SMS interception. Real-time phishing: sophisticated phishing proxies relay OTPs in real time, bypassing them. NIST SP 800-63B has restricted SMS OTP to 'restricted authenticator' status. Authenticator apps or hardware tokens are preferred.
TOTP: Time-Based One-Time Passwords
TOTP (Time-Based One-Time Passwords) — standardized in RFC 6238 — generates 6-digit codes from a shared secret and the current time. Apps like Google Authenticator, Authy, and Microsoft Authenticator implement TOTP. The code changes every 30 seconds and is only valid for one authentication attempt. Unlike SMS OTP, TOTP does not traverse the phone network, so it is immune to SIM swapping and SS7 attacks. The shared secret is exchanged once (via QR code during setup) and stored in the authenticator app — requiring physical access to the registered device to generate codes.
# TOTP algorithm (RFC 6238) conceptual implementation
import hmac, hashlib, time, struct, base64
def totp(secret_b32, digits=6, interval=30):
# Decode the base32 secret
secret = base64.b32decode(secret_b32, True)
# Time counter: number of 30-second intervals since epoch
counter = int(time.time()) // interval
# HMAC-SHA1 of counter with secret
msg = struct.pack('>Q', counter)
digest = hmac.new(secret, msg, hashlib.sha1).digest()
# Dynamic truncation to get 6 digits
offset = digest[-1] & 0xf
code = struct.unpack('>I', digest[offset:offset+4])[0] & 0x7fffffff
return str(code % (10**digits)).zfill(digits)FIDO2 and WebAuthn: Phishing-Resistant MFA
FIDO2 (Fast Identity Online 2) and its web implementation WebAuthn represent the most phishing-resistant authentication standard available. FIDO2 uses public key cryptography at the device level — the authenticator (hardware key like YubiKey, or device biometric like Windows Hello) stores a private key that never leaves the device. Authentication is cryptographically bound to the specific origin (website), making it immune to phishing: even if a user is tricked into visiting a fake site, the authentication challenge will fail because the origin doesn't match. FIDO2 is the gold standard for high-security authentication.
Hardware Tokens: HOTP and Smart Cards
Physical hardware tokens provide 'something you have' independent of smartphones. HOTP (HMAC-based OTP) — standardized in RFC 4226 — generates a code from a counter and shared secret; the counter increments each time the button is pressed. Unlike TOTP, HOTP codes don't expire on a timer but must be used in sequence. Smart cards (like PIV cards used by US government employees) store private keys in tamper-resistant hardware and require a PIN to unlock, combining 'something you have' (the card) with 'something you know' (PIN). Smart card authentication is the standard for privileged access in high-security environments.
Password Managers: Solving the Human Problem
Password managers solve the human tendency to reuse passwords by generating and storing unique, random passwords for every site. The master password unlocks an encrypted vault containing all credentials. Enterprise password managers (1Password Teams, Bitwarden Business, CyberArk) add features like centralized policy enforcement, audit logs, secure sharing, and emergency access. Security teams should actively encourage or mandate password manager adoption — it's a rare security control that improves both security (unique passwords everywhere) and usability (no need to remember dozens of passwords). Combined with MFA, password managers dramatically reduce credential-based account compromise.
Account Lockout and Throttling
Account lockout disables an account after a defined number of failed login attempts, preventing brute-force attacks. Typical policies lock an account after 3-10 failed attempts, with lockout duration ranging from a fixed period (30 minutes) to requiring admin unlock. Throttling is a softer alternative: instead of locking accounts, it progressively increases the delay between login attempts, making brute-force attacks take years instead of minutes without the user-experience impact of lockouts. Web applications should implement both — rate limiting at the API level and account-level throttling — to prevent automated credential attacks.
# Configure account lockout policy via Windows Group Policy
# Computer Configuration > Windows Settings > Security Settings
# > Account Policies > Account Lockout Policy
#
# Account lockout threshold: 5 invalid logon attempts
# Account lockout duration: 30 minutes
# Reset account lockout after: 30 minutes
# Linux PAM-based lockout (/etc/pam.d/common-auth)
# auth required pam_tally2.so deny=5 unlock_time=1800
# auth required pam_faillock.so preauth deny=5 unlock_time=1800Quick Check
Test your understanding of CompTIA Security+ (SY0-701) concepts from this lesson.
Lesson Recap
In this lesson you learned: NIST SP 800-63B recommends long passphrases and breach-checking over complex rotation policies; the three MFA factors are know, have, and are; TOTP apps are more secure than SMS OTP; FIDO2/WebAuthn is phishing-resistant; and account lockout prevents brute-force attacks. Next up we explore Biometrics and Token-Based Authentication.
Frequently asked questions
Is the “Password Policies and Multi-Factor Authentication” lesson free?
Yes — the full text of “Password Policies and Multi-Factor Authentication” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.
What will I learn in “Password Policies and Multi-Factor Authentication”?
Understand strong password requirements, MFA factors (something you know/have/are), and why layering factors dramatically reduces account compromise risk. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cloud & IT Cert Prep?
No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Password Policies and Multi-Factor Authentication” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cloud & IT Cert Prep lesson?
Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Password Policies and Multi-Factor Authentication
- Biometrics and Token-Based Authentication
- Authorization Models: RBAC, MAC, and DAC
- Federated Identity: SAML, OAuth, and OpenID Connect