Encryption Key Space Calculator
How many keys a given key length allows, and how long brute force would take — the arithmetic behind why 128-bit encryption is considered safe and 56-bit is not.
A key of n bits has 2ⁿ possible values, and brute force finds the right one after half of them on average.
How the encryption key space calculator works
A key of n bits has 2ⁿ possible values, and brute force finds the right one after half of them on average. The numbers grow so fast that intuition fails: 128-bit keys are not twice as hard as 64-bit, they are 18 quintillion times harder. That is why key length is chosen with an enormous margin — the goal is not to be expensive to break but to be impossible within the lifetime of the universe. Quantum computing changes the arithmetic for symmetric keys by roughly halving the effective strength (Grover's algorithm), which is why 256-bit keys are recommended for long-term secrets.
Formula: key space = 2ⁿ; average time = 2ⁿ ÷ 2 ÷ guesses per second
Worked examples
| Inputs | Average time to break | Note |
|---|---|---|
| 128-bit (AES-128) | 5.39e+12 years | far longer than the age of the universe |
| 56-bit (the old DES standard) | 36 ms | broken in a fraction of a second at this rate |
| 256-bit (AES-256) | 1.83e+51 years | safe even against a quantum attacker |
FAQFrequently asked questions
Why is 128-bit encryption considered unbreakable?
Trying half of 2¹²⁸ keys at a billion billion a second still takes billions of times the age of the universe. The limit is physics, not engineering budget.
Why use 256-bit keys then?
Margin. Grover's algorithm would roughly halve the effective strength of a symmetric key, so 256 bits keeps a comfortable 128-bit margin against a future quantum attacker.
Is a longer key always better?
Only up to a point — past 256 bits the key stops being the weak link. Attacks target implementations, passwords and people instead.
Does this apply to RSA keys?
No. RSA and elliptic-curve keys are attacked by factoring and discrete-logarithm methods, not brute force, so a 2048-bit RSA key is roughly comparable to a 112-bit symmetric key.
So why do systems still get broken?
Because attackers go around the encryption: weak passwords, stolen keys, unpatched software and phishing. Key length is rarely the weakest part.
Where these figures come from
- IEC 80000-13 — Information science and technology (quantities and units) — the decimal (kB, MB) versus binary (KiB, MiB) prefixes used throughout
- RFC 4632 — Classless Inter-domain Routing (CIDR) — the address-plan arithmetic behind the subnet calculator
- RFC 1918 — Address Allocation for Private Internets — the private ranges the subnet calculator recognises
- NIST SP 800-63B — Digital Identity Guidelines, Authentication — length over composition rules; the basis of the password guidance here
- NIST SP 800-57 Part 1 — Recommendation for Key Management — key-strength comparisons used by the key-space calculator
- Australian Cyber Security Centre — Essential Eight — national guidance on passphrases and system hardening
Last checked: September 2026. Units follow the SI decimal convention (IEC 80000-13 defines the binary alternatives); network and security figures cite the defining standard.