AI Launch Lab
Sign in FR Get updates

Cybersecurity basics · Lesson 1 of 3

Why length matters

An attacker who guesses passwords by trying every combination needs, in the worst case, pool ** length tries, where pool is the number of possible characters. Lowercase letters give 26, uppercase another 26, digits 10, and the 32 punctuation symbols on a keyboard another 32.

Length grows the count much faster than variety: each extra character multiplies it by the whole pool. A long passphrase of ordinary words is usually stronger, and easier to remember, than a short jumble.

This count is an upper bound. Real attackers try common passwords and leaked ones first, so Password1! falls in seconds whatever the formula says. Use a password manager and a different password for each site.

Your turn

Write pool_size(pw) (26 if it has a lowercase letter, plus 26 for uppercase, 10 for digits, 32 for punctuation) and search_space(pw), which returns pool_size(pw) ** len(pw).

Loading Python (about 12 MB, once)…

    Checks

    • ○ lowercase only: 26
    • ○ all four kinds: 94
    • ○ search space is pool to the power of length
    • ○ the long passphrase beats the short jumble

    Output

    All courses