Tech

Cyber security

Think like attacker and defender: store passwords properly, tell hashing from encryption, close the classic web flaws, spot the scams aimed at banks and respond to an incident in order.

7 concepts7 min read25-question test, from a bank of 33Updated

Concept 1 of 71 min

Passwords, brute force and second factors

The rule
Passwords are stored with a slow, salted hash such as bcrypt or Argon2, never a fast hash like SHA (Secure Hash Algorithm)-256.
Worked example

Brute force on short passwords

Given
Symbols36
Guesses1,000,000,000/s
Short6 characters
Medium8 characters
Long10 characters
  1. 6 characters: 366 ÷ 1,000,000,000 ≈ 2.18
  2. 8 characters: 368 ÷ 1,000,000,000 ≈ 2,821
  3. Each 2 more: 362 = 1,296 times
  4. 10 characters ≈ 2,821 × 1,296 ≈ 3,656,000

About 42 days for 10 characters against 2.18 seconds for 6: length beats complexity rules.

The picture
Formula
Combinations=alphabet size ^ length
time=combinations ÷ guesses per second
each extra character multiplies the work by the alphabet size
Why it holds

The search space is the alphabet size to the power of the length, so each extra character multiplies the attacker's work. A hardware security key (FIDO2) resists phishing better than codes, and credential stuffing is stopped by throttling and MFA (multi-factor authentication).

After a breach, attackers guess offline at billions of fast hashes a second; a hash designed to be slow makes each guess far dearer. Length beats complexity rules for strength.

A security key checks the real site's domain, so a look-alike page gets nothing, while codes from SMS (Short Message Service) or an app can be typed into a fake page and relayed.

Credential stuffing replays real passwords leaked elsewhere, so longer length rules do not help; throttling, second factors and rejecting known-breached passwords do.

Watch out
  • Storing passwords with SHA-256.
  • Relying on complexity rules instead of length.
  • Treating SMS codes as phishing-proof.
In the interview
  1. You are designing the login of a new client portal for a bank. What would you put in place?

    A complete answer covers

    • Store passwords with a slow, salted hash such as Argon2.
    • Offer phishing-resistant second factors, such as security keys or passkeys.
    • Throttle attempts and reject passwords known from breaches.
    • Alert on unusual logins: new device, country or time.

Also in our technical interviews, on camera, with a score.

Concept 2 of 71 min

Hashes: salts, one-way functions and checksums

The rule
A per-user salt makes 2 identical passwords hash differently and defeats precomputed tables.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 3 of 71 min

Encryption, TLS, certificates and keys

The rule
TLS (Transport Layer Security) uses public-key cryptography only to agree on a shared key, then a fast symmetric cipher such as AES (Advanced Encryption Standard).

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 4 of 71 min

Web flaws: injection, XSS, CSRF and access control

The rule
Parameterised queries send input as data so it cannot become SQL (Structured Query Language), and encoding output stops stored XSS (cross-site scripting).

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 5 of 71 min

How attackers go after banks

The rule
A message from 'IT' with a look-alike link is reported and the real address typed by hand.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 6 of 71 min

Defence: privilege, zero trust, patching, detection and response

The rule
Each account gets only the rights it needs, and zero trust checks identity and device on every request wherever it comes from.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 7 of 71 min

AdvancedHow a slow hash turns hours of cracking into years

The rule
The time to try every password is the search space divided by the guesses a second the hash allows.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Recap

  • Passwords: slow, salted hashes such as bcrypt or Argon2; length multiplies the search space; phishing-resistant keys beat codes.
  • A hash is one-way and checks integrity; encryption is reversible with a key, which must live apart from the data.
  • Parameterised queries stop SQL injection, output encoding stops XSS, tokens stop CSRF (cross-site request forgery), and every request checks ownership.
  • Urgent, secret payment requests are verified on a known channel; backups attackers cannot reach beat ransom.
  • Least privilege, zero trust, patch what is exploited and exposed first, and isolate an infected machine before anything else.
Now test it

25 questions on Cyber security

Timed, like the real one, drawn from a bank of 33. Every answer explained.

Test yourself →