Pular para o conteúdo

Hashing and digital signatures

Hashing protege integridade

  • Fazemos hash de senhas para sigilo. Hashing também protege integridade — provando que os dados não foram alterados.
  • Mude até um único caractere da entrada e o hash muda completamente.
import hashlib
print(hashlib.sha256(b"hello").hexdigest()[:16])
print(hashlib.sha256(b"hellp").hexdigest()[:16])   # totally different

Entrar ou criar conta

IGCSE, A-Level & AP