1. Home
  2. Explore
  3. Computer Science
  4. Average-Case Complexity

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Average-Case Complexity

Average-Case Complexity, Cryptography, and Statistical Inference

1. Connections Between Cryptography and Statistical Learning

Statistical learning and cryptography both study computational problems involving distributions over inputs, but they pursue opposite goals.

Statistical inference

In statistical inference, an algorithm receives data sampled from an unknown distribution and attempts to:

  • Infer the parameters governing the distribution.

  • Predict future samples.

  • Determine which of several hypotheses generated the data.

  • Recover hidden structure, such as a planted clique or a secret vector.

The central question is whether the hidden information can be extracted efficiently from random observations.

Cryptography

Cryptography attempts to construct distributions that are deliberately difficult to analyze or predict.

For example, in encryption:

  • A message is transformed into a ciphertext.

  • The ciphertext should appear random to an adversary.

  • An adversary should not be able to infer the underlying message.

  • Security requires that ciphertexts corresponding to different messages be computationally indistinguishable.

Statistical inference tries to recover hidden information from distributions; cryptography tries to construct distributions that hide information from efficient algorithms.

This duality makes cryptographic constructions useful for studying the computational limitations of statistical inference.


2. Why Average-Case Complexity Is Difficult

Traditional complexity theory is primarily concerned with worst-case complexity. A problem is considered hard if at least one input of each sufficiently large size is difficult.

Statistical and machine-learning problems are usually distributional problems:

  • Inputs are sampled from a specified distribution.

  • The algorithm is evaluated on typical random instances.

  • Hardness depends not only on the computational problem but also on the distribution of inputs.

This creates a conceptual difficulty. Worst-case hardness does not automatically imply that random instances are hard.

Two kinds of average-case hardness

The discussion distinguishes two important forms of average-case hardness.

Refutation hardness

A refutation algorithm must always be correct, but it may fail to provide an answer on some fraction of instances.

For example, an algorithm might:

  • Correctly certify that a random formula is unsatisfiable whenever it gives an answer.

  • Output “unknown” on some instances.

  • Never incorrectly declare a satisfiable formula unsatisfiable.

Refutation hardness concerns the inability to efficiently certify that typical random instances have a particular property.

Heuristic hardness

A heuristic algorithm is allowed to make errors, but it must succeed with sufficiently high probability, often on a non-negligible fraction of instances.

For cryptographic purposes, this type of hardness is especially important because an adversary may be allowed to fail occasionally, provided that it cannot reliably distinguish or recover secret information.

The two major barriers to basing cryptography on worst-case assumptions

A long-standing goal is to construct secure cryptography from the strongest possible general assumption:

P≠NP.P \ne NP.P=NP.

However, two separate transformations are needed:

  1. Worst-case hardness to average-case hardness

    • Convert the existence of difficult instances into hardness on randomly generated instances.

  2. Average-case hardness to cryptographic security

    • Convert a hard distributional problem into a cryptographic primitive, such as public-key encryption.

Most historical barriers focused on the first step. The second step asks whether a given average-case problem can actually support secure encryption.

The role of minimum time-bounded Kolmogorov complexity

A significant result concerning the first barrier uses a problem related to minimum time-bounded Kolmogorov complexity.

The relevant complexity-class picture contains:

  • PPP: problems solvable efficiently.

  • NPNPNP: problems for which positive instances have efficiently verifiable proofs.

  • coNPcoNPcoNP: problems for which negative instances have efficiently verifiable proofs.

The problem used in the worst-case-to-average-case result is believed to lie in NPNPNP but not in coNPcoNPcoNP. Earlier barriers often applied only to problems believed to lie in:

NP∩coNP.NP \cap coNP.NP∩coNP.

Thus, the result showed that several previously proposed obstacles to worst-case-to-average-case reductions were not universal. It did not produce cryptography directly, but it substantially changed the understanding of the first barrier.


Statistical Zero Knowledge

3. Why Statistical Zero Knowledge Is a Useful Target

Instead of studying all of NP∩coNPNP \cap coNPNP∩coNP, the discussion focuses on the smaller and especially well-structured class statistical zero knowledge, abbreviated SZK.

This class captures many problems with both:

  • A proof-like structure.

  • A way to verify correctness without revealing the underlying witness or secret information.

It is useful for studying cryptographic hardness because:

  • SZK has elegant definitions.

  • SZK contains many natural distributional problems.

  • SZK is closed under complements.

  • A statistical zero-knowledge algorithm or oracle can be used to distinguish carefully constructed distributions.

The central question is:

If statistical zero knowledge were computationally easy, which public-key encryption schemes could be broken?

This reframes the second barrier. Rather than starting from a general hardness assumption and constructing encryption, it examines existing encryption schemes and asks whether they already fall inside SZK.


4. Interactive-Proof Definition of SZK

An SZK protocol is an interactive proof between two parties:

  • A prover, who attempts to establish that a statement is true.

  • A verifier, who checks the statement.

The prover may possess information, such as a witness, that allows the statement to be demonstrated.

The defining additional property is statistical zero knowledge:

  • The verifier’s view of the interaction reveals essentially nothing beyond the validity of the statement.

  • The distribution of the verifier’s observations can be reproduced independently.

  • The simulated view is statistically close to the view generated during the real interaction.

In other words, the verifier could have generated an indistinguishable transcript without interacting with the prover.

Statistical zero knowledge means that a valid interactive proof can be simulated so accurately that the verifier gains no meaningful information from the interaction.

The word statistical indicates that the closeness between the real and simulated distributions is information-theoretic, rather than merely based on computational assumptions.


5. Statistical Distance and the Complete Problem for SZK

A second, equivalent characterization of SZK is based on a distribution-comparison problem.

Statistical distance

For two distributions AAA and BBB over the same domain, their statistical distance is

Δ(A,B)=12∑x∣Pr⁡[A=x]−Pr⁡[B=x]∣.\Delta(A,B) = \frac{1}{2}\sum_x \left| \Pr[A=x]-\Pr[B=x]\right|.Δ(A,B)=21​∑x​∣Pr[A=x]−Pr[B=x]∣.
  • If Δ(A,B)\Delta(A,B)Δ(A,B) is small, the distributions are statistically close.

  • If Δ(A,B)\Delta(A,B)Δ(A,B) is large, they are statistically far.

  • A statistical-distance problem usually has a promise that the two distributions are either sufficiently close or sufficiently far.

The complete problem

The input consists of two efficient sampling circuits:

  • Sampler AAA.

  • Sampler BBB.

Each sampler receives a random string and outputs a sample. The task is to decide whether:

  • AAA and BBB generate statistically close distributions, or

  • AAA and BBB generate statistically far distributions.

The sampler descriptions are not themselves distributions. Rather, they are circuits that efficiently generate samples from distributions.

This problem is complete for SZK. Therefore, if a computational task can be reduced to distinguishing close and far distributions, that task belongs to SZK.


Cryptographic Schemes Breakable with an SZK Oracle

6. ElGamal Encryption

ElGamal encryption is a public-key encryption scheme based on algebraic groups and the difficulty of problems such as decisional Diffie–Hellman.

Let:

  • GGG be a cyclic group with generator ggg.

  • sss be a randomly chosen secret key.

  • h=gsh=g^sh=gs be the public key.

  • mmm be a message represented as a group element.

Encryption

To encrypt mmm, choose random rrr and output the ciphertext

(X,Y)=(gr,hrm).(X,Y)=(g^r,h^r m).(X,Y)=(gr,hrm).

Decryption

Using the secret key sss:

YXs=hrm(gr)s=gsrmgsr=m.\frac{Y}{X^s} = \frac{h^r m}{(g^r)^s} = \frac{g^{sr}m}{g^{sr}} = m.XsY​=(gr)shrm​=gsrgsrm​=m.

Re-randomization

Suppose a ciphertext (X,Y)(X,Y)(X,Y) is raised componentwise to a fresh random exponent r′r'r′:

(Xr′,Yr′).(X^{r'},Y^{r'}).(Xr′,Yr′).

If the original ciphertext encrypts mmm, then

(Xr′,Yr′)=(grr′,hrr′mr′)(X^{r'},Y^{r'}) = \left(g^{rr'},h^{rr'}m^{r'}\right)(Xr′,Yr′)=(grr′,hrr′mr′)

in the basic algebraic form. More generally, using the appropriate group operation and message representation, the ciphertext can be transformed into a fresh-looking encryption of the same message.

The important property is that a ciphertext can be converted into another ciphertext drawn from the same message-dependent distribution without knowing the secret key.

Breaking ElGamal with statistical distance

Suppose the goal is to distinguish encryptions of messages m1m_1m1​ and m2m_2m2​.

Given a challenge ciphertext, construct two samplers:

  1. A sampler that re-randomizes the challenge ciphertext.

  2. A sampler that directly generates fresh encryptions of m1m_1m1​.

If the challenge encrypts m1m_1m1​, these samplers generate the same distribution.

If the challenge encrypts m2m_2m2​, they generate distributions that are far apart, assuming the messages are distinguishable.

An SZK oracle for statistical distance can therefore determine which message was encrypted.

General consequence

Any encryption scheme with an efficient re-randomization procedure can be attacked in this way:

  1. Take the challenge ciphertext.

  2. Generate fresh-looking ciphertexts from it.

  3. Compare their distribution with the distribution of encryptions of candidate messages.

  4. Use the statistical-distance oracle to identify the message.

A related observation is that sufficiently homomorphic encryption schemes are often re-randomizable. Therefore, excessive algebraic functionality can make a scheme a poor candidate for security based solely on assumptions such as P≠NPP \ne NPP=NP.

Re-randomizability creates a direct bridge between ciphertext indistinguishability and statistical-distance testing.


7. Regev’s Learning-with-Errors Encryption

Regev encryption is based on the learning with errors (LWE) problem.

The LWE assumption

Let:

  • AAA be a random matrix over Zq\mathbb{Z}_qZq​.

  • sss be a secret vector.

  • eee be a small noise vector.

  • bbb be a noisy linear combination:

b=ATs+e(modq).b=A^T s+e \pmod q.b=ATs+e(modq).

The LWE assumption states that the pair (A,b)(A,b)(A,b) is computationally indistinguishable from (A,u)(A,u)(A,u), where uuu is uniformly random and independent of AAA.

Thus, an efficient algorithm should not be able to determine whether bbb is:

  • A noisy linear combination of the columns of AAA, or

  • A completely random vector.

This is naturally a statistical-inference problem: the algorithm must distinguish two hypotheses about how observed data was generated.

Geometric interpretation

Consider:

  • The span of the columns of AAA.

  • The span generated by the columns of AAA together with bbb.

Under the LWE hypothesis:

  • If b=ATs+eb=A^T s+eb=ATs+e, then bbb is close to the span of AAA because eee is small.

  • If bbb is uniformly random, then bbb is typically far from the span of AAA.

Distinguishing the two cases with an SZK oracle

The Goldreich–Goldwasser idea adds carefully chosen random noise to samples from these spaces.

  • In the noisy-linear-combination case, the two resulting distributions become statistically close.

  • In the uniformly random case, the underlying spaces are already far apart, so the resulting distributions remain statistically far.

Therefore, a statistical-distance oracle can distinguish the LWE distribution from the uniform distribution.

From distinguishing to breaking encryption

Regev’s construction also has a search-to-decision reduction:

  • If an algorithm can distinguish the relevant distributions, it can recover information about the secret vector sss.

  • Once sss is recovered, ciphertexts can be decrypted.

  • Thus, distinguishing the LWE distribution is sufficient to break the encryption scheme.

Consequently, an SZK oracle can break Regev encryption by distinguishing the noisy linear structure from random data.


8. Alekhnovich’s Binary Encryption Scheme

Alekhnovich’s encryption scheme has an algebraic structure similar to LWE but operates over the binary field Z2\mathbb{Z}_2Z2​.

In Z2\mathbb{Z}_2Z2​:

  • Values are bits, 000 and 111.

  • Addition is XOR.

  • Noise can be generated by independently flipping each bit with probability ppp.

Public key

The public key consists of:

  • A random binary matrix AAA.

  • An additional vector formed from a random linear combination of the rows of AAA, plus noise.

The noisy vector contains the secret information.

Encryption of zero

To encrypt 000:

  1. Select a vector ccc from the dual space of the row space of AAA.

  2. Because ccc lies in the dual space, its inner product with every row of AAA is zero.

  3. Add additional noise to hide the fact that ccc was chosen from the dual space.

Encryption of one

To encrypt 111:

  1. Choose a completely random binary vector.

  2. Multiply the public matrix by this random vector.

The two message types therefore have different algebraic relationships to the public key.

Decryption

The secret key is multiplied by the ciphertext.

  • For an encryption of 000, the dual-space component vanishes under multiplication by the secret key. The result is primarily determined by the interaction between the secret-key noise and the encryption noise.

  • For an encryption of 111, the ciphertext contains a random component. Its inner product with the secret key behaves differently.

Correct decryption requires a noticeable statistical gap between these two cases.

Disjoint-support condition

A useful way to obtain this gap is to make the supports of the secret-key noise and encryption noise typically disjoint.

If the noise in both vectors is independently sampled with probability greater than approximately

1N,\frac{1}{\sqrt{N}},N​1​,

then collisions become likely.

At least one of the noise distributions must therefore have density around

1N\frac{1}{\sqrt{N}}N​1​

or smaller.

Why the same parameter enables an SZK attack

The critical noise level also enables a statistical-distance attack.

Suppose one distribution has approximately N\sqrt{N}N​ ones, while additional independent noise contributes approximately N/3N/3N/3 ones.

  • The total number of ones remains statistically close to a random vector with density 1/31/31/3, because N\sqrt{N}N​ is comparable to a standard-deviation-scale fluctuation.

  • In contrast, adding the same noise to an already random vector shifts the density substantially, from roughly 1/31/31/3 toward 1/21/21/2.

  • The resulting distributions are therefore statistically distinguishable.

This is notable because the parameter required for correct decryption is also the parameter that places the scheme within reach of an SZK statistical-distance procedure.

In Alekhnovich’s scheme, the noise level needed for decryption creates precisely the statistical variation that an SZK oracle can exploit.


9. Continuous LWE and the Ajtai–Work Construction

Continuous LWE was introduced partly because of its connection to learning problems involving mixtures of Gaussians.

The continuous-LWE distribution

A sample is a vector of real numbers in which:

  • Most coordinates are drawn from continuous Gaussian distributions.

  • One hidden direction contains a discrete Gaussian component.

  • The discrete Gaussian has approximately the same mean and standard deviation as the continuous Gaussian.

  • A random rotation hides the special direction.

Without the random rotation, the distributions are easy to distinguish by inspecting the exceptional coordinate:

  • One case has discrete behavior.

  • The other case is entirely continuous.

After applying a random rotation, the hidden direction is unknown, and the resulting distributions are conjectured to be computationally indistinguishable.

Public and secret keys

The public key is a matrix whose columns are independent samples from the hidden continuous-LWE distribution.

The secret key is the hidden direction in which the discrete Gaussian components occur.

Encryption

A simplified version of the construction encrypts two messages as follows.

Encryption of zero

  • Choose a random vector with entries in {+1,−1}\{+1,-1\}{+1,−1}.

  • Multiply the public-key matrix by this vector.

  • Apply a rounding function.

The result is a signed combination of public-key samples.

Encryption of one

  • Generate an independent Gaussian vector.

  • Use it as the ciphertext, with the same general dimensions as the encryption of zero.

Decryption

The secret direction is applied to the ciphertext.

  • For an encryption of zero, the secret direction extracts discrete-Gaussian components. A signed sum of these components tends to be close to an integer.

  • For an encryption of one, the ciphertext is an independent Gaussian vector. Its projection remains Gaussian and is generally not close to an integer.

The message can therefore be determined by testing whether the resulting value lies near an integer.

The rounding function

Rounding is necessary for the security argument.

The real line is divided into a polynomial number of intervals, or buckets, chosen so that each interval has approximately equal Gaussian probability.

Each coordinate is replaced by the label of the interval containing it.

This rounding has a pseudorandomness property:

  • If the public matrix were composed of purely continuous Gaussian samples, then rounded encryptions of zero and one would be statistically close, even when the matrix itself is known.

  • This makes it difficult for an adversary to distinguish the two messages in the random-matrix case.

A statistical zero-knowledge protocol

The following protocol distinguishes a genuine hidden-continuous-LWE public matrix from a purely random matrix.

  1. The verifier receives a matrix XXX.

  2. The verifier does not know whether XXX is a genuine public key or a random matrix.

  3. The verifier encrypts a random message MMM using XXX.

  4. The verifier sends the ciphertext to the prover.

  5. The prover returns a candidate message M′M'M′.

  6. The verifier accepts if M′=MM'=MM′=M.

Genuine public-key case

If XXX is a genuine public key:

  • The prover can use the hidden direction to decrypt.

  • The prover returns the correct message with high probability.

  • The verifier accepts.

Random-matrix case

If XXX is random:

  • Rounded encryptions of zero and one are statistically close.

  • The prover cannot reliably determine which message was encrypted.

  • The verifier therefore accepts with only limited probability.

Zero-knowledge property

The protocol is statistical zero knowledge because the verifier already knows the message it chose to encrypt. The response it expects is predictable from the verifier’s own randomness, so the interaction reveals no additional secret information.

This places the hidden-continuous-LWE distinguishing problem in SZK.

The construction does not, by itself, completely establish an efficient method for directly decrypting every ciphertext using an SZK oracle. Distinguishing a genuine public key from a random matrix is a closely related but technically distinct task.


Broader Relationships Among Hardness Assumptions

10. Cryptographic Problems in or Near NP∩coNPNP \cap coNPNP∩coNP

Several important cryptographic assumptions arise from problems believed to lie in NP∩coNPNP \cap coNPNP∩coNP, including:

  • Shortest vector or shortest independent vector problems, in suitable formulations.

  • Learning with errors.

  • Related lattice and algebraic problems.

The examples above suggest that several encryption schemes based on these assumptions can be attacked using statistical zero knowledge.

This does not prove that the underlying cryptographic problems are easy in polynomial time. Instead, it shows that their hardness may be limited relative to stronger complexity classes or oracles.

The distinction is important:

  • A problem may be hard for ordinary polynomial-time algorithms.

  • The same problem may become easy with access to an SZK oracle.

  • Therefore, it may not be suitable as a foundation for cryptography derived from a very strong assumption such as P≠NPP \ne NPP=NP.


11. Average-Case Problems Outside SZK

Many statistical problems are naturally placed in NPNPNP because a witness can certify the planted structure.

Planted clique

Given a graph containing a hidden large clique, a witness can explicitly identify the clique. This makes the problem naturally related to NPNPNP.

However, it is unclear whether planted clique belongs to:

NP∩coNPNP \cap coNPNP∩coNP

or to SZK.

A statistical zero-knowledge proof that a graph contains a planted clique would need to demonstrate the existence of the clique without revealing the clique itself. Because SZK is closed under complements, such a proof could also yield a way to refute the corresponding alternative.

There is currently no clear evidence from the discussion that planted clique is outside SZK. The claim that it is not in SZK remains speculative.

Relative hardness

Once many problems are known to be difficult for polynomial-time algorithms or restricted algorithmic models, a natural next question is how they compare to one another.

Possible approaches include studying whether access to:

  • An SZK oracle.

  • An NPNPNP oracle.

  • A stronger oracle such as a quantified or proof-search oracle.

allows efficient solutions in parameter regimes that are currently inaccessible to ordinary polynomial-time algorithms.

This would produce a more refined map of average-case hardness.


Random 3-SAT as an Example of Oracle-Assisted Refutation

12. Refuting Random 3-SAT

Consider a random 3-SAT formula with a varying number of clauses.

Low clause density

When the number of clauses is sufficiently small:

  • The random formula is typically satisfiable.

  • Proving that it is unsatisfiable is therefore not a meaningful task on typical instances.

High clause density

When the number of clauses becomes sufficiently large, roughly beyond a scale of the form

n3/2,n^{3/2},n3/2,

there are algorithms capable of certifying unsatisfiability or otherwise refuting the random instance.

Intermediate regime

Between the low- and high-density regimes lies an intermediate range where refutation is believed to be difficult for efficient algorithms.

Work on random 3-SAT showed that access to an appropriate oracle can extend refutation beyond the range achievable by ordinary algorithms.

For refutation, an NPNPNP oracle can be interpreted as supplying a certificate that the formula is unsatisfiable, even when efficiently finding such a certificate is difficult.

This demonstrates that oracle access can reveal structure in average-case problems that remains hidden from polynomial-time algorithms.

Random 3-SAT illustrates how relative complexity—rather than polynomial-time hardness alone—can provide a richer understanding of average-case problems.


Open Directions and Conceptual Lessons

13. Potential Statistical Zero-Knowledge Proofs for Learning Problems

A major open direction is to construct SZK protocols for problems such as:

  • Planted clique.

  • Random constraint satisfaction problems.

  • Other planted-instance problems.

  • Statistical and machine-learning tasks involving hidden structure.

Such a protocol would need to prove that the hidden structure exists while revealing essentially nothing about the structure itself.

Because SZK is closed under complements, success in one direction could have consequences for the complementary problem as well. This makes SZK especially powerful for analyzing both:

  • The existence of a planted object.

  • The absence of such an object.

Cryptography as a route to SZK

One possible strategy is indirect:

  1. Construct an encryption scheme from a statistical problem.

  2. Use an SZK oracle or protocol to break the encryption.

  3. Infer that the underlying statistical problem has a low-complexity distributional characterization.

A second strategy is direct:

  1. Identify two distributions corresponding to competing hypotheses.

  2. Design an interactive protocol distinguishing them.

  3. Prove that the verifier’s view can be statistically simulated.

Both approaches could clarify whether particular statistical problems are genuinely hard or merely difficult for currently known algorithmic techniques.


14. Main Takeaways

Cryptography and statistical inference are dual: one seeks to infer hidden information, while the other seeks to hide it.

Average-case hardness has multiple layers: worst-case hardness must first be converted to average-case hardness, and average-case hardness must then be converted into cryptographic security.

SZK is characterized by indistinguishability of statistically close and statistically far distributions.

Re-randomizable encryption is vulnerable to an SZK statistical-distance oracle because ciphertext distributions can be compared with freshly generated encryptions.

Regev, Alekhnovich, and related LWE-based schemes exhibit different mechanisms by which statistical-distance procedures can exploit their structure.

Oracle-relative complexity may reveal distinctions among statistical problems that are invisible when all problems are classified simply as easy or hard for polynomial-time algorithms.

The broader lesson is that the structure of a cryptographic construction—not only the presumed hardness of its underlying problem—determines whether it can serve as a foundation for secure encryption.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent