Hashing
Cryptographic hashing gera um digest de tamanho fixo a partir de dados de entrada de qualquer tamanho, com propriedades de determinismo, não-inversibilidade e resistência a colisão, permitindo integridade e autenticação de dados.
Uma cryptographic [[hash function](/pt/terms/hash-function)](/pt/terms/cryptographic-hash-function) recebe uma entrada de comprimento arbitrário e retorna um digest de tamanho fixo. É caracterizada por determinismo, tamanho de saída fixo e one-wayness. Além de ser determinística e de tamanho fixo, as cryptographic hash functions visam fornecer preimage resistance (dado um digest, encontrar um preimage é infactível), second-preimage resistance (um input diferente com o mesmo digest é infactível) e collision resistance (difícil de encontrar dois inputs que colidam). Elas são projetadas para serem eficientes de computar, e o digest de saída deve exibir o avalanche effect: uma pequena mudança no input resulta em um digest significativamente diferente. São usadas em verificações de integridade de dados, assinaturas digitais e password hashing quando apropriado. Nota: um nonce não é uma propriedade da hash function em si; pode ser usado em protocolos para salting ou variar contextos de hashing, mas não faz parte da propriedade central da hash function.
graph LR
Center["Hashing"]:::main
Rel_iteration["iteration"]:::related -.-> Center
click Rel_iteration "/terms/iteration"
Rel_hash_function["hash-function"]:::related -.-> Center
click Rel_hash_function "/terms/hash-function"
Rel_consensus_mechanism["consensus-mechanism"]:::related -.-> Center
click Rel_consensus_mechanism "/terms/consensus-mechanism"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Teste de conhecimento
🧒 Explique como se eu tivesse 5 anos
Hashing is like making a smoothie out of a fruit. You can easily turn a strawberry into a smoothie, but there's no way to turn the smoothie back into a strawberry. Also, a single strawberry will always make the exact same smoothie!
🤓 Expert Deep Dive
## The Significance of SHA-256
SHA-256 is the beating heart of the Bitcoin network. It is used to create the linked 'chain' by including the previous block's hash in the current block, and it powers the Proof-of-Work mining system where miners compete to find a specific hash. Its 256-bit output provides 128-bit 'collision security,' which remains strong even against the most advanced classical computers.