Home

Hashing

Hashing refers to the process of converting input data of arbitrary length into a fixed-size string of characters, typically produced by a hash function. The output is commonly called a hash value or hash code. A hash function is deterministic: the same input always yields the same hash. A good hash function also aims to distribute outputs uniformly and be efficient to compute. The output length is fixed for a given hash function, regardless of input size.

There are cryptographic hash functions and non-cryptographic hash functions. Cryptographic hashes, such as SHA-256 and SHA-3,

Common applications include using hashes in hash tables to map keys to buckets; in content-addressable storage

Limitations and concerns include the possibility of hash collisions, since many inputs can share the same hash.

are
designed
to
be
resistant
to
various
attacks:
preimage
resistance
(difficult
to
reverse),
second
preimage
resistance,
and
collision
resistance
(difficult
to
find
two
inputs
with
the
same
hash).
They
are
used
for
data
integrity,
digital
signatures,
and
password
storage
when
combined
with
salts
and
key
stretching.
Non-cryptographic
hashes,
such
as
those
used
in
hash
tables
or
checksums,
prioritize
speed
and
uniform
distribution
and
do
not
provide
strong
security
guarantees.
and
version
control
systems
where
data
is
addressed
by
its
hash;
in
data
deduplication
and
caching;
and
in
distributed
systems
using
consistent
hashing
to
balance
load.
Some
older
algorithms,
such
as
MD5
and
SHA-1,
have
vulnerabilities
and
are
being
phased
out
for
security-sensitive
use.
A
hash
is
not
encryption,
and
reversing
a
hash
to
retrieve
the
original
data
is
not
generally
feasible,
but
the
original
data
can
sometimes
be
inferred
with
sufficient
effort
if
the
hash
is
weak.
Password
storage
typically
uses
salted
hashing
to
enhance
security.