Skip to content · ⁨Bỏ qua nội dung⁩

Hashing and digital signatures · ⁨Hashing và chữ ký số⁩

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.
Tiếng Việt

HASH bảo vệ tính toàn vẹn

  • Chúng ta đã tạo hash cho mật khẩu nhằm mục đích giữ bí mật. Hash cũng bảo vệ tính toàn vẹn — chứng minh dữ liệu không bị thay đổi.
  • Chỉ cần thay đổi một ký tự đầu vào, giá trị hash sẽ thay đổi hoàn toàn.
import hashlib
print(hashlib.sha256(b"hello").hexdigest()[:16])
print(hashlib.sha256(b"hellp").hexdigest()[:16])   # totally different

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP