# Cryptographic Hash

Key: `technology.cryptographic.hash`

Output of a cryptographic hash function (MD5, SHA-1, SHA-256, etc.). Detected as hex string of fixed length. Broad categorization by length.

Page: <https://meridian.online/docs/projects/finetype/types/technology/cryptographic/hash>

Samples: `5d41402abc4b2a76b9719d911017c592`, `aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d`, `2c26b46911185131006dfb3b57a99d73`

## Background

### Origin

RFC 1321, The MD5 Message-Digest Algorithm, was written by R. Rivest and published in April 1992.[[1]](https://www.rfc-editor.org/rfc/rfc1321) RFC 1321 describes MD5 as producing a 128-bit fingerprint or message digest of its input.[[1]](https://www.rfc-editor.org/rfc/rfc1321) RFC 1321 says the MD5 algorithm is intended for digital signature applications.[[1]](https://www.rfc-editor.org/rfc/rfc1321) The reference code in RFC 1321 prints a message digest in hexadecimal.[[1]](https://www.rfc-editor.org/rfc/rfc1321) The test suite in RFC 1321 gives the MD5 digest of the empty string as d41d8cd98f00b204e9800998ecf8427e.[[1]](https://www.rfc-editor.org/rfc/rfc1321) MD5 hashes are typically represented as a sequence of 32 hexadecimal digits.[[2]](https://en.wikipedia.org/wiki/MD5)

SHA-1 produces a 160-bit (20-byte) hash value, typically written as 40 hexadecimal digits.[[3]](https://en.wikipedia.org/wiki/SHA-1) The SHA-2 family was designed by the National Security Agency and first published in 2001.[[4]](https://en.wikipedia.org/wiki/SHA-2) NIST's FIPS 180-4, the Secure Hash Standard, specifies seven hash algorithms: SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256.[[5]](https://csrc.nist.gov/projects/hash-functions) FIPS 180-4 states that the digests are used to detect whether messages have been changed since the digests were generated.[[6]](https://csrc.nist.gov/pubs/fips/180-4/upd1/final)

### Use

PostgreSQL's md5 function computes the MD5 hash of its argument with the result written in hexadecimal, so md5('abc') returns 900150983cd24fb0d6963f7d28e17f72.[[7]](https://www.postgresql.org/docs/current/functions-string.html) Python's hashlib hexdigest method returns the digest as a string of double length containing only hexadecimal digits, for exchanging the value safely in email or other non-binary environments.[[8]](https://docs.python.org/3/library/hashlib.html)

NIST deprecated the use of SHA-1 in 2011 and disallowed its use for digital signatures at the end of 2013.[[5]](https://csrc.nist.gov/projects/hash-functions) Researchers at CWI Amsterdam and Google published two different PDF files with the same SHA-1 hash on 23 February 2017.[[3]](https://en.wikipedia.org/wiki/SHA-1) The GNU Coreutils manual says the chance of two files accidentally having identical MD5 sums is vanishingly small, but that md5sum should not be considered secure against malicious tampering.[[9]](https://www.gnu.org/software/coreutils/manual/html_node/md5sum-invocation.html) An MD5 or SHA-1 column is still fine for spotting duplicate or corrupted files, but treat it as weak evidence that nobody has tampered with them. (Meridian's view)

### Where you'll meet it

The SHA256SUMS file for Debian's current amd64 CD images lists one 64-character lowercase hexadecimal digest per line, followed by the image's file name.[[10]](https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS)

## Sources

1. [RFC 1321: The MD5 Message-Digest Algorithm](https://www.rfc-editor.org/rfc/rfc1321) — standard
2. [MD5](https://en.wikipedia.org/wiki/MD5) — secondary source
3. [SHA-1](https://en.wikipedia.org/wiki/SHA-1) — secondary source
4. [SHA-2](https://en.wikipedia.org/wiki/SHA-2) — secondary source
5. [Hash Functions \| CSRC](https://csrc.nist.gov/projects/hash-functions) — organisation
6. [FIPS 180-4, Secure Hash Standard (SHS) \| CSRC](https://csrc.nist.gov/pubs/fips/180-4/upd1/final) — catalogue entry
7. [PostgreSQL: Documentation: 18: 9.4. String Functions and Operators](https://www.postgresql.org/docs/current/functions-string.html) — documentation
8. [hashlib — Secure hashes and message digests](https://docs.python.org/3/library/hashlib.html) — documentation
9. [md5sum invocation (GNU Coreutils 9.12)](https://www.gnu.org/software/coreutils/manual/html_node/md5sum-invocation.html) — documentation
10. [SHA256SUMS](https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS) — dataset
