$linuxjunkies
>

hash

also: checksum, digest, hash value, cryptographic hash

A mathematical function that converts input data of any size into a fixed-length string of characters, used to verify data integrity and create secure checksums. In Linux, hashes are commonly used to verify file authenticity and store password hashes.

A hash is a one-way cryptographic function that takes any amount of input data and produces a fixed-length output called a hash value or digest. Even tiny changes to the input produce completely different hash values, making hashes excellent for detecting file corruption or tampering.

Common hash algorithms in Linux include MD5, SHA-1, SHA-256, and SHA-512. You can generate hashes using commands like sha256sum myfile.txt or md5sum document.pdf.

Hash functions are used in several ways: verifying downloaded files match their published checksums, storing password hashes in /etc/shadow instead of plaintext passwords, and ensuring data hasn't been modified in transit or at rest. For example: echo 'hello' | sha256sum always produces the same 64-character hexadecimal output.

Related terms