Free online courseInteractive · No sign-up · Works offline once loaded

Account security: passkeys, 2FA & password managers

How accounts really get taken over, and how to lock yours so a leaked password, a fake login page or a stolen phone number gets nobody in. With real crypto running in your browser.

  • Beginner
  • 8 chapters
  • 29 interactive lessons
  • About 39 minutes
  • English
  • Updated November 2026
Start the course 29 lessons · about 39 min · free
How accounts get taken over Lesson 1 of 29

Chapter 1: How accounts get taken over

Lesson 1.1 · How accounts get taken over

Four ways into your account

Almost every account takeover starts in one of four ways. None of them needs a genius hacker. They are automated, cheap and run day and night.

For each one there is a defence you can switch on today. This course goes through them one by one.

Try itTap each way in.

Tap a part

Four doors, four locks. Which one is open for you?

Lesson 1.2 · How accounts get taken over

One leak, many doors

A small online shop gets hacked. Its customer list contains your email address and your password.

A bot now tries this pair on hundreds of other sites. That is credential stuffing. Wherever you used the same password, the door opens.

With a different password for every site, one leak stays one problem.

Try itLeak the shop with one password everywhere. Then switch to unique passwords and run it again.

  • shop.exampleSummer2025!leaked
  • mail.exampleSummer2025!–
  • northbank.exampleSummer2025!–
  • social.exampleSummer2025!–
  • cloud.exampleSummer2025!–

The bot is waiting for the leak.

Lesson 1.3 · How accounts get taken over

After the login: the session cookie

After you log in, a site doesn’t ask for your password on every click. It gives your browser a session cookie: a long random value that says “already signed in”.

Malware called an infostealer copies these cookies. Whoever has the cookie is you, without password and without second factor.

Chrome 146 can bind a session to a key inside your device. A copied cookie then expires within minutes.

Try itLet the infostealer copy the cookie. Then bind the session to the device and try again.

Lesson 1.4 · How accounts get taken over

Which way was it?

Six short stories. Which of the four ways did the attacker use?

Knowing the way tells you the fix: a new password helps against stuffing, but not against a stolen session or a hijacked phone number.

Example 1

Chapter 2: Password managers

Lesson 2.1 · Password managers

Hundreds of passwords, one to remember

A password manager creates a different random password for every site and remembers it. You remember one: the master password.

Random means made by the computer, not by you. 20 characters from about 70 symbols give more than 120 bits. Nobody guesses that, not with every graphics card on Earth.

Try itMove the slider and switch character types. Watch the bits.

–

Made in your browser with crypto.getRandomValues(). Similar letters like l, 1, O and 0 are left out. Nothing is stored or sent.

Lesson 2.2 · Password managers

How the vault is locked

Your vault leaves your device only encrypted. From your master password the app derives a key, slowly on purpose: Bitwarden uses 600,000 rounds of PBKDF2 by default.

The provider stores only the locked vault. It can’t read it, and it can’t reset your master password. That is zero knowledge.

Simplified: real apps add more layers, 1Password for example a Secret Key on your devices.

Try itUnlock with the right master password. Then change a single letter.

  1. Derive the key: PBKDF2-SHA256, 600,000 rounds, with salt–
  2. Decrypt with AES-256-GCMv5/2/4KWWXVuPnmCKZKcF7QV7aq+2Dp2MHGvfCaDeTcQ…
  3. ResultLocked
What the provider stores
{
  "kdf": "PBKDF2-SHA256",
  "iterations": 600000,
  "salt": "AyA9WneUsc7rCCVCX3yZtg==",
  "iv": "BRYnOElaa3yNnq/A",
  "ciphertext": "v5/2/4KWWXVuPnmCKZKcF7QV7aq+2Dp2MHGvfCaD…"
}
Lesson 2.3 · Password managers

Autofill reads the real address

A password manager is also a phishing filter. It saved your login for one exact address and fills it in only there.

Your eyes read “northbank” in all of these. The manager sees letters from other alphabets and checks the real domain at the end.

If it stays empty where you expected it to fill in, stop and look again.

Try itCheck each address. Would your password manager fill in your login?

Saved in your password managernorthbank.exampleyou@mail.example · ••••••••••••
  • login.northbank.example
  • northbank-login.example
  • nоrthbank.example
  • northbank.example.account-check.net

Your eyes can be fooled. The manager compares the exact address.

Lesson 2.4 · Password managers

What if the manager itself is hacked?

In 2022 attackers stole encrypted vault backups from LastPass. Now they could guess master passwords offline, as long as they liked.

Crypto thefts of about 35 million dollars were later traced to cracked vaults, mostly of long-time customers with weak master passwords.

Two things decide how long a stolen vault holds: your master password and the number of key-stretching rounds.

Try itPick a master password and a number of rounds.

Master password
Key-stretching rounds
Time to try every candidate–

Assumption for comparison: an attacker who tests one billion candidates per second at one round. Real speeds depend on the hardware; the ratios stay the same.

Lesson 2.5 · Password managers

Choosing a password manager

The best password manager is the one you actually use, on all your devices.

The managers built into Apple, Google and Microsoft are free and already there. Independent ones work across all systems and browsers, and some are open source.

Two questions give you a starting point. Everything in detail: password managers compared.

Your devices
What matters most?

Answer the questions to see a suggestion.

Compare all password managers →

Chapter 3: Second factors

Lesson 3.1 · Second factors

Know, have, are

Two-factor authentication means two different kinds of proof:

  • something you know: password, PIN
  • something you have: phone, security key
  • something you are: fingerprint, face

Password plus security question is still one kind. Both can be phished or guessed.

Example 1

Lesson 3.2 · Second factors

Codes by text message

SMS codes are much better than nothing. In a 2019 Google study, they stopped all automated bots and 96% of bulk phishing.

But a phone number can be stolen. In a SIM swap, an attacker talks your provider into moving your number to his SIM. From then on, your codes go to him.

Use SMS where there is nothing else, and switch to an app or a passkey as soon as you can.

982SIM swap complaints to the FBI in 2024
$26 millionreported losses
96 %bulk phishing stopped by SMS codes (Google, 2019)
Your call

Your bank only offers codes by SMS. What do you do?

Lesson 3.3 · Second factors

Authenticator app: a code from time and a secret

When you set up an authenticator app, the site and your phone share a secret, usually through a QR code.

Every 30 seconds both compute an HMAC of the current time step with that secret and cut it down to six digits. That is TOTP, RFC 6238. Nothing travels over the phone network.

Try itScan the QR code with your own authenticator app. Both show the same code.

Code right now––– –––
Secret (Base32)
–
Time step floor(unix / 30)
–
HMAC-SHA1 offset from the last digit
–
31-bit number mod 1,000,000
–

A demo account named “encode-decode demo”, made in your browser. Delete it from your app afterwards. The secret is never sent.

Lesson 3.4 · Second factors

Push prompts and MFA fatigue

“Is this you trying to sign in?” Tap yes, done. Convenient, but attackers who know your password can send prompt after prompt, at night, until you tap yes to make it stop.

That happened to an Uber contractor in 2022. The attacker added a WhatsApp message posing as IT support.

Number matching fixes it: you type the number shown on the login screen. Only someone who sees that screen knows it.

Try itLet the attacker send prompts. Then switch on number matching.

No requests

The attacker has your password, not your phone.

Chapter 4: Why codes can be phished

Lesson 4.1 · Why codes can be phished

A fake page that forwards in real time

Modern phishing pages sit between you and the real site. What you type goes straight on, what the real site answers comes straight back. This is adversary-in-the-middle phishing.

You type your password, then your code. The real site logs you in, and the attacker keeps the session.

Anything you can read and type can be relayed.

Try itRun the attack with each sign-in method.

Younorthbank-secure.examplenorthbank.example

    Lesson 4.2 · Why codes can be phished

    Which factor stops what?

    Google tested this on real hijacking attempts in 2019. Any second factor stopped the automated bots. Against targeted attackers the differences were large.

    Only methods that check the address themselves, security keys and passkeys, are called phishing-resistant. CISA and NIST recommend them for important accounts.

    SMS code100 %bots96 %bulk phishing76 %targeted
    Prompt on the phone100 %bots99 %bulk phishing90 %targeted
    Security key100 %bots100 %bulk phishing100 %targeted

    Share of hijacking attempts stopped. Google, NYU and UC San Diego, 2019.

    Quick check

    Which of these is phishing-resistant?

    Lesson 4.3 · Why codes can be phished

    Four habits against phishing

    Technology does most of the work. These habits cover the rest, also for accounts that don’t offer passkeys yet.

    • Bookmark, not linkOpen banks, email and shops from a bookmark or the app, never from a message.
    • Codes are for screensNo real support asks for a code. Hang up and call back on the known number.
    • Empty autofill = stopIf your manager doesn’t fill in, read the address once more, slowly.
    • Passkey where you canEvery account you move to a passkey drops out of this chapter.

    Chapter 5: Passkeys

    Lesson 5.1 · Passkeys

    A key pair instead of a password

    A passkey is a key pair. Your device keeps the private key; the website gets only the public key.

    To sign in, the site sends a random challenge. Your device asks for your fingerprint or PIN and signs it. The site checks the signature with the public key.

    Nothing to type, and nothing on the server that opens an account if it leaks.

    Try itCreate a passkey, then sign in. The crypto is real.

    Your phone keepsPrivate key–never leaves the device
    northbank.example storesPublic key04eb72df8d977165de…f5273f6402useless to a thief
    1. Site sends a challenge–
    2. Phone signs challenge + real address–
    3. Site checks with the public key–

    ECDSA P-256 like real passkeys (ES256), computed in your browser. Nothing is stored on your device.

    Lesson 5.2 · Passkeys

    Why a fake site gets nothing

    A passkey belongs to one site. On northbank-secure.example the browser simply doesn’t offer the passkey for northbank.example.

    And even a signature forced out by malware would carry the wrong address. The real site checks the origin and rejects it.

    You can’t be tricked into using it in the wrong place, because you never choose the place.

    Try itSign in on the real site, then on the lookalike.

      Lesson 5.3 · Passkeys

      Synced or device-bound

      Most passkeys are synced: they live in your password manager and come back on a new phone.

      Device-bound passkeys stay on one security key and can’t be copied at all. Good for admins and your most important accounts; register two keys in case you lose one.

      Since 2026 you can even move passkeys between password managers.

      Try itTap all four tiles.

      Tap a part

      Both are phishing-resistant. They differ in what happens when you lose a device.

      7 billionpasskeys in use (FIDO, Oct 2026)
      AAL2NIST level for synced passkeys
      2025Microsoft: new accounts passwordless by default
      Lesson 5.4 · Passkeys

      Signing in on someone else’s computer

      Your passkey is on your phone, but you are at a library computer. No problem: the computer shows a QR code, your phone does the signing.

      Bluetooth checks that your phone is really next to that computer. A phishing site far away can’t use the trick.

      1. “Use a phone or tablet”
        On the computer you choose to sign in with a passkey from another device. A QR code appears.
      2. Scan with your phone
        Your phone’s camera opens the passkey prompt for this site.
      3. Bluetooth checks the distance
        Phone and computer confirm over Bluetooth that they are next to each other. The data itself travels encrypted over the internet.
      4. Fingerprint on the phone
        Your phone signs the challenge for the site on the computer’s screen.
      5. Signed in, nothing left behind
        No password was typed on the foreign keyboard. Sign out when you’re done.

      Chapter 6: “Sign in with Google, Apple & Co.”

      Lesson 6.2 · “Sign in with Google, Apple & Co.”

      What the app learns about you

      Each way of signing up gives the app something different. With a social login, no app stores a password of yours, which is good. But the app may get your real address and a link to a big account.

      Try itTap each way of signing up.

      Tap a part

      No option is perfect. Compare what each one hands over.

      Lesson 6.3 · “Sign in with Google, Apple & Co.”

      One account, many doors

      If you sign in to 30 apps with Google, your Google account becomes the master key. Someone who gets into it gets into all 30. If you lose it, you are locked out of all 30.

      That is fine, as long as this one account is the best-protected thing you own.

      App 1App 2App 3App 4App 5App 6 Youraccount
      Your move

      You sign in to most apps with one big account. What do you do first?

      Chapter 7: Recovery and sessions

      Lesson 7.1 · Recovery and sessions

      The back door: account recovery

      Every lock has a back door: “forgot password”. Attackers aim right there, with SIM swaps and fake support calls.

      When you turn on 2FA, you get backup codes. Each opens your account once if your phone is lost. Treat them like a spare house key.

      On Apple devices, up to five recovery contacts can give you a code, without any access to your account.

      Try itMake a set of demo backup codes. Then decide where they go.

      1. –––– ––––
      2. –––– ––––
      3. –––– ––––
      4. –––– ––––
      5. –––– ––––
      6. –––– ––––
      Where do they go?

      Where do you keep your backup codes?

      Lesson 7.2 · Recovery and sessions

      Check where you are signed in

      Most services show where your account is signed in right now, with device, browser and rough location.

      Look now and then. An unknown device means someone has a session, maybe through a stolen cookie. Ending it, or signing out everywhere, throws them out.

      Try itFind the session that isn’t yours and end it.

      • This laptopFirefox · Windows · active now
      • Your iPhoneSafari · iOS · 2 hours ago
      • Unknown Windows PCChrome · a city you have never been to · today, 03:12
      • Living room TVStreaming app · last week

      Four sessions. Is every one yours?

      Lesson 7.3 · Recovery and sessions

      Hacked? The order matters

      If someone took over an account, act fast, but in the right order.

      Changing the password on an infected laptop hands the new one to the malware. And attackers like to leave a back door: their own phone number, a forwarding rule, a connected app.

        Tap the steps in the right order.

        Lesson 7.4 · Recovery and sessions

        When you can’t anymore

        Accounts outlive phones, and sometimes people. Decide now who may get in if you can’t, before it matters.

        And one look ahead: digital ID wallets will prove who you are, but they don’t replace your logins.

        Try itTap each option.

        Tap a part

        Ten minutes now save your family weeks later.

        Chapter 8: Your plan and final check

        Lesson 8.1 · Your plan and final check

        Your 15-minute plan

        Start where a takeover would hurt most: your main email, because it resets every other account.

        Tick what you use and get a short plan in the right order. Print it or work through it right now.

        Try itTick what you have. Get a plan in the right order.

          Lesson 8.2 · Your plan and final check

          Ready to protect someone else too?

          Ten questions on everything in this course. Try as often as you like.

          Question 1 of 100 correct

          Course complete

          Almost there

          You have seen 0 of 29 lessons.

          Put your name on the certificate, then print it or save it as a PDF. Your name stays in this browser.

          encode-decode Academy

          Certificate of completion

          Your name

          has completed the free online course

          Account security: passkeys, 2FA & password managers

          8 chapters · 29 interactive lessons · about 39 minutes

          encode-decode.com/academy/account-security/

          Course notes

          The course as text

          Everything from the lessons in 8 short chapters, to read or to look something up later.

          Chapter 1

          How accounts get taken over

          Almost every account takeover starts in one of four ways. Reused passwords: attackers take email and password pairs from old leaks and try them on other sites, automatically. This is called credential stuffing. At 23andMe in 2023, about 14,000 accounts were opened this way, and through a family-matching feature the data of about 6.9 million people leaked. Phishing: a fake login page or a caller collects your password and codes. Stolen sessions: malware copies the cookie that keeps you signed in, so the attacker needs neither password nor second factor. Recovery tricks: attackers take over your phone number (SIM swap) or talk a support agent into resetting your account.

          None of this needs a genius. It is automated and cheap. The defences are simple too: a different password for every site (chapter 2), a second factor (chapter 3), a factor that can't be phished (chapters 4 and 5), and a recovery that only you can use (chapter 7).

          Session theft is the newest front. Since spring 2026, Chrome 146 on Windows binds sessions to a key in the device (Device Bound Session Credentials) on websites that support it. A copied cookie then expires within minutes and can't be renewed elsewhere.

          Open the lessons of chapter 1 →
          Chapter 2

          Password managers

          A password manager creates and remembers a different random password for every site. You remember only one: the master password. Random means made by the computer, not by you: 20 characters from about 70 symbols give more than 120 bits of randomness, far beyond what any attacker can guess.

          The vault leaves your device only encrypted. From the master password, the app derives a key, slowly on purpose: Bitwarden uses PBKDF2-HMAC-SHA256 with 600,000 rounds by default, or Argon2id; 1Password uses 650,000 rounds and mixes in a 128-bit Secret Key that never leaves your devices. The provider stores only the encrypted vault. It can't read it and can't reset your master password. This is called zero-knowledge or end-to-end encryption.

          A password manager is also a phishing filter: it fills in a login only on the exact address it was saved for. Lookalike domains with letters from other alphabets (shown as Punycode, xn--…) or the real name at the start of a foreign domain don't fool it.

          What if the provider is hacked? In 2022 attackers stole encrypted vault backups from LastPass and could guess master passwords offline. Later, crypto thefts of about 35 million dollars were traced to cracked vaults, mostly of long-time customers with weak master passwords and older, lower round counts. The lesson: a long, random master password, and an app that uses current key stretching. To choose one, see our password manager comparison.

          Open the lessons of chapter 2 →
          Chapter 3

          Second factors

          Two-factor authentication (2FA) combines two different kinds of proof: something you know (password, PIN), something you have (phone, security key) and something you are (fingerprint, face). A password plus a security question is still one kind: both are knowledge.

          SMS codes are much better than nothing: in a 2019 Google study, an SMS code to a recovery phone blocked 100% of automated bots and 96% of bulk phishing. But a phone number can be stolen: in a SIM swap, the attacker gets your number moved to his SIM. The FBI received 982 such complaints in 2024. NIST's guidelines (SP 800-63B-4, 2025) treat SMS and voice codes as a restricted, weaker option.

          Authenticator apps compute a six-digit code from a shared secret and the time (TOTP, RFC 6238): every 30 seconds, an HMAC-SHA1 of the time step, cut down to six digits. Nothing travels over the phone network. Push prompts are convenient but invite MFA fatigue: in 2022 an attacker flooded an Uber contractor with prompts and then posed as IT support on WhatsApp until one was accepted. Microsoft has enforced number matching in Authenticator since 8 May 2023: you type the number shown on the login screen, so blind approvals no longer work.

          Open the lessons of chapter 3 →
          Chapter 4

          Why codes can be phished

          Modern phishing pages don't just collect passwords. They sit as a proxy between you and the real site (adversary-in-the-middle, AiTM): what you type is passed on in real time, what the real site answers is shown to you. You enter your password and your code, the real site logs you in, and the attacker keeps the session cookie. Microsoft described such a campaign that targeted more than 10,000 organisations from September 2021 and led to business email fraud. It is not a flaw in the codes: any factor that you can read and type can be relayed.

          Phishing-resistant methods don't give you anything to type. A security key or a passkey signs a challenge together with the address the browser is really on. On a fake address, the passkey for the real site isn't even offered, and a signature made there would name the wrong origin. That's why CISA and NIST recommend phishing-resistant MFA, and why the 2019 Google study found that security keys stopped all of the targeted attacks it looked at.

          Habits still matter: open important sites from a bookmark or the app, never read a code to a caller, and treat an empty autofill as a warning sign.

          Open the lessons of chapter 4 →
          Chapter 5

          Passkeys

          A passkey replaces the password with a key pair. When you create one, your device makes a private key that never leaves it (or your password manager) and gives the website only the public key. To sign in, the website sends a random challenge; your device asks for your fingerprint, face or PIN and signs the challenge together with the address the browser is really on. The website checks the signature with the public key. There is nothing to type, nothing to forget and nothing worth stealing on the server: a leaked list of public keys opens no account.

          Passkeys are bound to the site they were made for (the relying party). On a lookalike address the browser doesn't offer them, and a signature from the wrong origin fails the check. That is what makes them phishing-resistant. The standard behind them is WebAuthn (W3C) with FIDO2.

          Synced passkeys live in a password manager such as iCloud Keychain, Google Password Manager, 1Password or Bitwarden and come back on a new phone; NIST SP 800-63B-4 accepts them at assurance level 2. Device-bound passkeys on a security key can't be copied at all; they're the choice for the highest level (AAL3) and for admins. Since 2025 and 2026, passkeys can also move between password managers with the FIDO Credential Exchange standard (CXP), on iOS 26 and on Android with Google Password Manager since June 2026. By October 2026 the FIDO Alliance estimated 7 billion passkeys in use.

          On someone else's computer you can sign in with the passkey on your phone: the computer shows a QR code, your phone scans it, Bluetooth checks that the phone is really nearby, and the phone signs. For accounts with only one device-bound key, register a second one as a spare.

          Open the lessons of chapter 5 →
          Chapter 6

          “Sign in with Google, Apple & Co.”

          “Sign in with Google” or “Sign in with Apple” uses OAuth and OpenID Connect: the app never sees your password. Your account provider asks you to agree, then hands the app a token with exactly the permissions you agreed to, the scopes. Name and email address are harmless; “read all your email” or “see all your files” are not. Some attackers build apps only to collect such permissions: consent phishing. Read the consent screen like a contract, and remove apps you no longer use in your account’s security settings.

          Apple can hand the app a relay address instead of your real email (Hide My Email); Google and Microsoft share the address of your account. The upside of signing in this way: one strong account with a passkey protects many apps, and no app stores a password of yours. The downside: that one account becomes the key to everything. Secure it first, with a passkey and recovery options (chapter 7). How it works for developers and companies: OAuth, OpenID Connect & SAML.

          Open the lessons of chapter 6 →
          Chapter 7

          Recovery and sessions

          Every lock has a back door: “forgot password”. Attackers know that, which is why SIM swaps and fake support calls aim at recovery. Close the door for everyone but you: save the backup codes when you turn on 2FA, on paper or in your password manager, not as a photo or an email. Keep your recovery email and phone current. Apple lets you name up to five recovery contacts who can give you a code, without access to your account.

          Look at where you are signed in now and then. Most services list your sessions with device and place, and offer “sign out everywhere”. If an account was taken over, the order matters: first a clean device (otherwise malware steals the new password too), then a new password, then sign out all sessions, then check 2FA methods, recovery details, forwarding rules and connected apps, which attackers like to add.

          And think one step further. Apple's Legacy Contact and Google's Inactive Account Manager let you decide who gets access when you can't anymore; Google deletes personal accounts after two years without activity. Password managers offer emergency access for family. In Germany, the state EUDI wallet is due in early 2027: it proves who you are, for example to a bank, but doesn't replace your logins.

          Open the lessons of chapter 7 →
          Chapter 8

          Your plan and final check

          You don't need to fix everything today. Start where a takeover would hurt most: your main email account, because it resets all others. Then the account you sign in with everywhere (Apple, Google or Microsoft), then banking and payment, then the rest. For each: a passkey if offered, otherwise a unique password from your manager plus an authenticator app; backup codes saved; recovery details current. Once a year, look at your sessions and connected apps.

          To try the building blocks from this course on your own: the Hashing & password security course shows how websites store passwords and how leaked hashes are cracked; the HMAC generator computes the function inside every authenticator code; and our comparison helps you pick a password manager.

          Open the lessons of chapter 8 →
          Glossary

          Words you will meet

          2FA / MFA
          Signing in with two (or more) different kinds of proof: knowledge, possession, being.
          AiTM phishing
          A fake site that relays everything to the real site in real time and keeps the session.
          Backup codes
          One-time codes that open your account if your second factor is lost.
          Consent screen
          The page where you allow an app to use your account, with a list of permissions (scopes).
          Credential stuffing
          Trying leaked email and password pairs on other sites, automatically.
          Device-bound passkey
          A passkey that can’t leave its security key or device.
          Infostealer
          Malware that copies saved passwords and session cookies from a computer.
          MFA fatigue
          Flooding someone with push prompts until they approve one.
          Number matching
          You type the number shown on the login screen into the app to approve.
          Passkey
          A key pair that replaces the password. The private key stays on your devices.
          Phishing-resistant
          A method that checks the real address itself, so nothing can be relayed.
          Session cookie
          A random value that tells a website you are already signed in.
          SIM swap
          Moving your phone number to the attacker’s SIM card.
          TOTP
          Time-based one-time password: an HMAC of the time and a shared secret.
          Zero knowledge
          The provider stores only encrypted data it can’t read.

          Searches the list of pages on this site. What you type stays in your browser.