Skip to content

Hashing and digital signatures · ⁨哈希与数字签名⁩

English

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 · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩