_ _ _
| | | | __ _ ___| |__ ___ ___
| |_| |/ _` / __| '_ \ / _ \/ __|
| _ | (_| \__ \ | | | __/\__ \
|_| |_|\__,_|___/_| |_|\___||___/
WHAT IS A HASH ALGORITHM? THE SHA-1 AND MD5 ALGORITHMS
Theoretically, MD5 and SHA1 are algorithms for computing a 'condensed
representation' of a message or a data file. The 'condensed representation' is
of fixed length and is known as a 'message digest' or 'fingerprint'.
What makes this exercise useful, is that it is conjectured that it is
computationally infeasible to produce two messages having the same message
digest. This uniqueness enables the message digest to act as a 'fingerprint'
of the message… opening up the possibility of using this technology for
issue like data integrity and comparison checking.
For instance when you download or receive a file, you can use MD5 or SHA-1 to
guarantee that you have the correct, unaltered file by comparing its hash with
the original. You are essentially verifying the file’s integrity.
It needn’t be a file of course - any message or similar construct for which
you need to ensure integrity can be verified in this way. All sorts of
possibilities emerge…
SHA-1: The Secure Hash Algorithm (SHA) was developed by NIST and is specified
in the Secure Hash Standard (SHS, FIPS 180). SHA-1 is a revision to this
version and was published in 1994. It is also described in the ANSI X9.30
(part 2) standard. SHA-1 produces a 160-bit (20 byte) message digest. Although
slower than MD5, this larger digest size makes it stronger against brute force
attacks.
MD5: MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16
byte) message digest makes it a faster implementation than SHA-1.
In both cases, the fingerprint (message digest) is also non- reversible….
your data cannot be retrieved from the message digest, yet as stated earlier,
the digest uniquely identifies the data.
References
[MD5] Rivest, R., "The MD5 Message-Digest Algorithm",
RFC 1321, April 1992.
http://www.faqs.org/rfcs/rfc1321.html
[SHA] NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995.