Generic attacks
A generic attack uses a primitive only as a black box: it evaluates the keyed function, hash function or group operation on inputs of its choice and compares the results, so it applies to every instance with the same key length, output length or group order. Its cost caps the security those parameters can give. Security strength is counted in bits as in Bar20 (Section 5.6.1.1): an algorithm provides bits of security if breaking it takes work comparable to trying all keys of a symmetric-key algorithm with -bit keys and no shortcut attack. Costs below count evaluations of the primitive or group operations.
Exhaustive key search
Let be a PRF whose samples uniformly from , and fix distinct inputs and distinct keys .
\begin{algorithm}
\algname{Algorithm}
\caption{Key search $\calA^{\calO}(1^\secpar)$ against $\PRF$}
\begin{algorithmic}
\For{$i = 1, \ldots, r$}
\State $y_i \gets \calO(x_i)$
\EndFor
\For{$j = 1, \ldots, t$}
\If{$\Eval(k_j, x_i) = y_i$ for all $i \le r$}
\Return $0$
\EndIf
\EndFor
\Return $1$
\end{algorithmic}
\end{algorithm}
makes queries and at most evaluations of . In with it outputs whenever , which has probability . With the answers are independent and uniform on , so each fixed passes the test with probability , and outputs with probability at most . Since ,
— standard. With queries, the false-positive term is at most , so the advantage is at least ; with the adversary tries every key and has advantage at least . Against a PRP on a domain of size , with world 1 a uniformly random permutation, the false-positive term is at most : the answers are then a uniform -tuple of distinct elements, and each , a permutation, maps the distinct to distinct values — standard.
If for a constant and infinitely many , the adversary with and queries, which fit in the superpolynomial domain of a PRF once is large, is efficient and has advantage at least for those , so pseudorandomness requires — standard. Concretely, about evaluations buy advantage at least , so work divided by advantage is at most about , and trying the keys in a fixed order reaches a uniform key after trials on average — standard. A -bit key thus gives at most about bits of security, and a target of bits needs . Bar20 (Section 5.6.1.1) defines security strength by this attack: given a few plaintext–ciphertext pairs, breaking an algorithm with bits of security takes encryptions on average.
Generic collision search
For every with , the birthday attack evaluates on independent uniform inputs, stores the pairs, and finds a collision with probability at least for ; for with , evaluations succeed with probability greater than — standard, proved on that page. Rho search finds a collision of a uniformly random function on with probability , after evaluations in expectation and with memory; for a fixed that analysis is a heuristic — standard. An -bit hash function therefore gives at most about bits of collision resistance, and a target of bits needs . Asymptotically, collision resistance requires (birthday bound).
Generic discrete logarithms
Let have prime order and with uniform in , as in (DLOG). For , storing the baby steps for and computing the giant steps for until one is stored finds whenever , with group operations and stored elements, hence with probability — standard. The choice is Shanks’s baby-step giant-step algorithm, which always succeeds — Sha71 (credited by BS16, Section 1). Pollard’s method computes with a heuristic expected group operations and stored elements — Pol78. In a cyclic group of composite order with known factorization, the Pohlig–Hellman reduction reduces discrete logarithms to discrete logarithms in subgroups of the prime orders and, with baby-step giant-step there, takes group operations, so the largest prime factor of the order sets the generic cost — PH78 (credited by GB08, Section 2.3.1); the derivation is under DLOG § Attacks.
Baby-step giant-step is optimal among generic algorithms up to a constant factor: in a group of prime order , every generic algorithm making group-operation queries computes with probability — Sho97 (GGM ⇒ DLOG, whose Notes give the bound ). With the attack above achieves with about operations, so generic discrete logarithms in a group of prime order give about bits of security, and a target of bits needs — standard. Discrete logarithms in also fall to non-generic, subexponential index-calculus and number-field-sieve algorithms, which force a much larger modulus (DLOG § Attacks).
Quantum generic attacks
Quantum key search
Let , and the be as in exhaustive key search, with obtained by classical queries, and let if for all and otherwise, computed by a reversible circuit that evaluates times. With the key satisfies , so has solutions among keys. The search of BBHT98 for an unknown number of solutions checks every candidate it measures and stops only on a solution; there is a constant such that it finds one after at most evaluations of in expectation — BBHT98 (Theorem 3, with classical sampling when ). Stopping it after evaluations of , and outputting if it has found a key with and otherwise, gives a quantum adversary that queries its oracle only classically, at , and evaluates times in superposition. With , by Markov’s inequality the search has found a solution by then with probability at least ; with the adversary can output only if some key passes the test, which has probability at most . Hence
— standard. With the advantage is at least . Counted in evaluations, a -bit key therefore gives at most about bits of security against a quantum adversary, and a target of bits needs in this count. An attack that only evaluates is unstructured search, for which this is optimal: finding a unique solution with constant probability takes evaluations — BBBV97, Zal97 (Grover search).
Key search at bounded depth
Consider unstructured search for one marked element among , with copies of the oracle queried simultaneously in each of rounds, and let and be the final states when no element and when is marked. Then (Section 4), and if the algorithm identifies the marked element with probability on average over , then (Appendix 5.1) — Zal97. Since and ,
— standard. For constant the total number of queries is : a bound on the number of sequential query rounds raises the cost of searching keys from to , and the full quadratic speedup needs rounds. NIST’s estimate for key search on AES-128 has this form, quantum gates for a depth bound MAXDEPTH between and logical gates — NIST17 (Section 4.A.5).
Quantum collision search
For an -to-one function , , with , the algorithm of BHT98 tabulates on points and runs Grover search for an input that collides with a table entry; it finds a collision after an expected evaluations of in space , and for every with some instance uses space and an expected evaluations — BHT98 (Theorem 2, Corollary 3). For an -to-one onto , gives evaluations, against about for the birthday attack, while gives , no fewer evaluations than rho search — standard, from Corollary 3. The table lives in quantum memory, read-only, and with sorting the running time is for computable in time — BHT98 (Section 3). For functions that are not -to-one, BHT98 describe the modification (a random table and the search of BBHT98) without stating a bound. Counted in evaluations, an -to-one function onto thus gives at most about bits of collision resistance against a quantum adversary with quantum memory.
Shor’s algorithm
Shor’s algorithm factors -bit integers and computes discrete logarithms in in time polynomial in — Shor97 (FAC ∈ BQP, DLOG ⊆ BQP). The discrete-logarithm algorithm uses few properties of : it needs the order of the generator, which quantum order finding can compute, and polynomial-time multiplication and inversion — Shor97 (Section 6), with each group element given a unique encoding — standard; for elliptic-curve groups over an -bit prime field it uses gates and roughly qubits — PZ03 (Section 6). Its cost grows polynomially with the bit length of the modulus or group order, as do the costs of the honest algorithms, so no choice of RSA modulus or group order gives superpolynomial security against a quantum adversary — standard.
Key lengths
Sizes giving each classical security strength, from Bar20 (Sections 5.6.1.1 and 5.6.1.2, Tables 2 and 3):
| Strength (bits) | Block cipher | Hash, collision resistance | Elliptic-curve order (bits) | RSA modulus (bits) | Finite field: public key, private key (bits) |
|---|---|---|---|---|---|
| 112 | 3TDEA | SHA-224, SHA-512/224, SHA3-224 | 224–255 | 2048 | 2048, 224 |
| 128 | AES-128 | SHA-256, SHA-512/256, SHA3-256 | 256–383 | 3072 | 3072, 256 |
| 192 | AES-192 | SHA-384, SHA3-384 | 384–511 | 7680 | 7680, 384 |
| 256 | AES-256 | SHA-512, SHA3-512 | 512+ | 15360 | 15360, 512 |
The AES rows match from exhaustive key search, the hash column from the birthday attack, and the elliptic-curve column, the bit length of the order of the base point, a group order of about bits from generic discrete logarithms; the RSA modulus and the finite-field public key are larger because the number field sieve and index calculus are not generic (factoring § Attacks, DLOG § Attacks) — standard. Bar20 marks the RSA and elliptic-curve estimates as significantly affected once quantum computing becomes practical (Table 2), and accepts 112 bits for applying protection through 2030 and 128 bits or more beyond (Section 5.6.3, Table 4); 3TDEA is deprecated through 2023 and disallowed afterwards for applying protection (Table 2, note). NIST’s post-quantum categories 1 to 5 require every attack to need resources comparable to or greater than key search on AES-128, collision search on SHA-256, key search on AES-192, collision search on SHA-384 and key search on AES-256, respectively, and NIST recommends parameters in categories 1 to 3 as likely to provide sufficient security for the foreseeable future — NIST17 (Section 4.A.5).