Skip to content

Hashing and digital signatures

Hashing protects integrity

  • We hashed passwords for secrecy. Hashing also protects integrity — proving data was not changed.
  • Change even one character of the input, and the hash changes completely.
import hashlib
print(hashlib.sha256(b"hello").hexdigest()[:16])
print(hashlib.sha256(b"hellp").hexdigest()[:16])   # totally different

Log in or create account

IGCSE & A-Level