Today:
Definition: A cryptographic hash function h
maps bit-strings of arbitrary length to a fixed-length output in an efficient, deterministic, public, “random”, manner
h : {0,1}* -> {0,1}^d
/\ /\
\ \
\ \--------- all strings of length d
\
\---- all strings of any length >= 0
h
Random oracle theoretical model not achievable in practice (some proofs on the storage requirements I think are out there)
Oracle “in the sky”:
x
and returns output h(x)
, for any x \in {0,1}*
such that |h(x)| = d
bitsx
, if x
is not in the oracle’s book:d
times to determine h(x)
(x, h(x))
in the booky
where (x,y)
is in the bookMany cryptographic schemes are proved secure in the Random Oracle Model (ROM), which assumes the existence of such an RO. Then, we assumes it is fine (a big assumption that some cryptographers don’t like) to replace the RO with a normal hash function like SHA in practice.
These properties are expressed informally here:
y
to find any x'
such that h(x') = y
x
is a preimage of y
x'
can be found by brute-force in \theta(2^d)
timex, x'
s.t. x != x
and h(x) = h(x')
2^{d/2} x
values before a pair of two x
values is found such that h(x1) = h(x2), x1 != x2
h
cannot be injective) because the domain of the function is infinite while the codomain/image is of cardinality 2^d
x
to find x' != x
such that h(x) = h(x')
x'
can be found by brute-force in \theta(2^d)
timeh
is indistinguishable under black-box access from a random oracle”h(0)
is for instance, and with high probability, the RO will output a different value on input 0
)h(x)
, to produce h(x')
where x
and x'
are related such as x' = f(x)
, for some function f
Theorem: If h
is CR, then h
is TCR.
Theorem: h
is OW does not imply h
is CR.
Theorem: h
is CR does not imply h
is OW.
Theorem: h
is CR and h
“compresses” implies h
is OW.
See Phillip Rogaway’s paper for proofs and for more interesting properties of hash functions.
h(password)
, not password
on serverh(password)
should not reveal password
(or any equivalent preimage)h
to be one-way (OW): guarantees (1) adversary doesn’t learn anything about password and (2) adversary cannot come up with a p'
such that h(p') = h(password)
f
store h(f)
securelyf
has been modified by recomputing h(f)
h(f)
as the one I stored, otherwise attacker can modify f -> f'
and h(f) -> h(f')
f'
such that h(f') = h(f)
M
is done by signing m = H(M)
instead (hash & sign)s
is computed as s = sign(M, secret_key)
h(M)
from M
then verifies signature s
verify(M, s, public_key)
x, x'
with h(x) = h(x')
, then Alice can ask Bob to sign x
and claim (or prove to Charlie) that Bob signed x'
h(x) = x
is still correct (just not as space efficient as we might want)x
to Bob and then reveal it later to Bobx
(e.g. auction bid)x
by computing C(x)
C(x)
as her sealed commitment (i.e. sealed bit)C(x)
later and reveal x
to whomever she committed toProperties:
C(x)
in more than one way (she is committed to just one x
)C(x)
learns anything about x
C(x)
, it shouldn’t be possible to produce C(f(x))
for some function f
How can we build a commitment scheme?
Let the commitment be equal to C(x)
, where C(x) = h(r||x), r <--R-- {0,1}^256
C(x)
to Bob but not r
r
to Bobr
allows us to maintain the secrecy propertyNeed:
x
h(r||x)
leaks info about x
that could be good enough for Bobx, x'
where h(x) = h(x')
, commit to x
and then reveal x'
instead of x