LOGBOOK

HELP

1 / 27
Other keys: showSpace: good1-4: rate0: skip5: flag

Question

What is a one-way function, and why is the word "impossible" in its definition not mathematically exact?

Answer

A one-way function is easy to compute in one direction (y = f(x)) but computationally infeasible to invert (finding x from y).

One-way function: easy forward, infeasible to invert without a trapdoor

* Easy one way, practically impossible the other — a trapdoor (like RSA's prime factors) is the only shortcut back. *

The formal definition:

  1. Computing $y = f(x)$ is computationally easy (polynomial time)
  2. Computing $x = f^{-1}(y)$ is technically impossible — meaning it would take the best algorithms with massive resources over 100,000 years

The terms "easy" and "impossible" aren't mathematically rigorous — they're practical statements about computational effort. Mathematically, "easy" means polynomial time, and "impossible" means the inverse computation time grows exponentially per bit.

Tip: Think of a blender — turning fruit into a smoothie is easy, but reconstructing the original fruit from the smoothie is practically impossible.

Go deeper:

The idea of trapdoor function. A trapdoor function f with its trapdoor t can be generated by an algorithm Gen. f can be efficiently computed, i.e., in probabilistic polynomial time. However, the computation of the inverse of f is generally hard, unless the trapdoor t is given.[1]
The idea of trapdoor function. A trapdoor function f with its trapdoor t can be generated by an algorithm Gen. f can be efficiently computed, i.e., in probabilistic polynomial time. However, the computation of the inverse of f is generally hard, unless the trapdoor t is given.[1]
IkamusumeFan · CC BY-SA 4.0 · Wikimedia Commons
or press any other key

Question

What is a hash function in the most general sense, and what are the three types classified by security and key usage?

Answer

A hash function maps elements from a large (arbitrary-size) set to a small fixed-size set — like a funnel compressing data.

The three types of hash function: checksum, MAC, MDC

* Three families: a Type-1 checksum (no key, not secure), a Type-2 MAC (keyed, secure) and a Type-3 MDC (keyless, secure). *

Output sizes are typically: 128, 160, 224, 256, 384, or 512 bits.

The three types:

Type Key? Crypto-Secure? Name Example
Type 1 No No Checksum / check digit ISBN, EAN, CRC
Type 2 Yes Yes MAC (Message Authentication Code) CBC-MAC, HMAC
Type 3 No Yes MDC (Manipulation Detection Code) SHA-2, SHA-3

Important naming note: MAC should really be called MIC (Message Integrity Code), since it provides integrity, not the full palette of authentication. The misnaming dates back to the 1970s when integrity and authenticity were conflated.

Go deeper:

A cryptographic hash function (specifically SHA-1) at work. A small change in the input (in the word "over") drastically changes the output (digest). This is called the avalanche effect.
A cryptographic hash function (specifically SHA-1) at work. A small change in the input (in the word "over") drastically changes the output (digest). This is called the avalanche effect.
User:Jorge Stolfi based on Image:Hash_function.svg by Helix84 · Public domain · Wikimedia Commons
or press any other key