a one-way function
Some processes are easy to do but hard to undo. Smashing a plate takes a second; reassembling it from the shards is a nightmare. Mixing two paint colours is instant; separating them back is essentially impossible. A one-way function is the mathematical version of this asymmetry: a function f that is easy to compute in the forward direction (given x, computing f(x) is fast) but hard to invert (given only the output y = f(x), finding any x that maps to it is computationally infeasible).
Precisely, f is one-way if it can be computed in polynomial time, yet for any efficient (polynomial-time) algorithm trying to invert it, the chance of finding a valid preimage of a random output is negligibly small. The forward direction is cheap; the backward direction defeats every fast attacker. Crucially this is about computational hardness, not impossibility: a preimage always exists and could be found by brute-force search over all inputs, but that search is astronomically slow, so for practical purposes the function cannot be reversed. The whole point is the gap between 'easy forward' and 'infeasible backward'.
One-way functions are the bedrock assumption of modern cryptography. From them you can build pseudorandom generators, secure password hashing, digital signatures, commitment schemes, and (as noted) zero-knowledge proofs for all of NP. Here is the deep and humbling honesty: we do not know that one-way functions exist. Their existence would imply P is not equal to NP (inverting is an NP-style search, so if P = NP nothing is genuinely one-way) but is believed to be even stronger. So essentially all of practical cryptography rests on an unproven assumption — candidates like integer factoring and discrete logarithms are believed hard, not proven hard, and a proof either way would be a landmark.
Multiplying two large prime numbers p and q to get n = p times q is fast and easy. But given only n, recovering its prime factors p and q is believed to be infeasible for huge numbers — no known fast algorithm does it on a classical computer. This forward-easy, backward-hard gap is the candidate one-way function behind RSA encryption.
Easy one way, infeasible the other: the asymmetry that lets cryptography lock and only the right key unlock.
We do NOT know whether one-way functions exist — their existence would imply P is not NP and is conjectured to be even harder to establish. 'Hard to invert' means computationally infeasible, not literally impossible: a brute-force inverse always exists but is astronomically slow.