# Hashing (Cryptography)

> Turning any data into a short code. It can never be turned back.

**Field:** Software Development  
**Category:** Security  
**Also known as:** Hash, Hash Function, Cryptographic Hash, SHA-256, Checksum

## Think of it like

Think of it like a fingerprint for a file. A tiny change makes a whole new print.

## Definition

Hashing turns any data into a short code of fixed length, called a hash. It cannot be undone. The same input always gives the same hash. Change one letter and the hash changes completely. SHA-256 is a common method, and its hash is 64 characters of hex. Hashes are used to check files were not changed and, with slow methods, to store passwords.

## Example

Jack downloads a 2 GB file and its published SHA-256 hash. He hashes his copy, the two match, so the file arrived unchanged.

## Example code

```console
$ echo -n hello | sha256sum
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824  -
$ echo -n Hello | sha256sum
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969  -
```

One capital letter, and the whole hash changes.

## Why it matters

It lets you prove data was not changed, and store secrets you never need to read back.

## Common mistake

Calling hashing a kind of encryption. Encryption can be undone with a key; a hash cannot be undone at all.

## Three principles

- **One way.** No way back.
- **Same in, same out.** Every time.
- **Small change, new hash.** Changes are easy to spot.

## Related terms

- [Encryption](https://learn.benibix.com/term/development/encryption)
- [Password Hashing](https://learn.benibix.com/term/development/password-hashing)
- [Hash Table](https://learn.benibix.com/term/development/hash-table)
- [Dependency Scanning](https://learn.benibix.com/term/development/dependency-scanning)
- [Hashed Email](https://learn.benibix.com/term/marketing/hashed-email)
- [Webhook Signature](https://learn.benibix.com/term/development/webhook-signature)
- [Block (Blockchain)](https://learn.benibix.com/term/development/blockchain-block)

## Told apart from

- [Hashing vs Encryption](https://learn.benibix.com/compare/hashing-vs-encryption): Hashing and encryption both scramble data, but only encryption can be undone. Encryption uses a key, so someone with the key can read the data again. A hash is a one-way fingerprint. It has no key and no way back. Use encryption for data you need to read later. Use hashing to check files or store passwords.

---

Source: https://learn.benibix.com/term/development/hashing
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
