Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Blockchain - Hash functions, Appunti di Informatica

Hash functions in cryptography (blockchain applications)

Tipologia: Appunti

2025/2026

Caricato il 23/02/2026

diego-formenti
diego-formenti 🇮🇹

18 documenti

1 / 1

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
Hash functions: small computer programs which transform any kind of data into a string
of fixed length, regardless the size of input data (many-to-one function). The number of
possible inputs is larger than the number of possible outputs.
Cryptographic hash functions: 3 properties:
1) Preimage resistance: it is computationally infeasible to calculate any preimage x
of a given y (H(x)=y)
2) Second presage resistance: it is computationally infeasible to find a different input
string x such that H(x) = H(x)
3) Collision resistance: it is computationally infeasible to find a pair of distinct input
strings x, x such that H(x) = H(x)
+ Deterministic: identical hash values for identical input data;
+ Pseudorandom: the hash value returned by the hash function changes (pseudo)
randomly when the input data are changed.
Requirement to be a “good” hash function: the relation between the input bit string x and
the output bit string y should be complicated to prevent easy recovery of x from y.
SHA-256 (Secure Hash Algorithm): 256 bits in the output, 264-1 bits in the input. No formal
proof that it is a cryptographic hash function, but it has no known weaknesses.
What if we have to provide one unique hash value for several independent data? You can’t
use a hash function directly: the idea is to build structures made by hash functions.
Different patterns:
Independent hashing;
Repeated hashing: apply the hash function to the output of the step before;
Combined hashing: combine all the single data into one and then apply the hash
function, since it is computationally intensive use this method with small data;
Sequential hashing: incremental update of a hash value as new data arrives
(combined + repeated), useful if we want a single updated hash value;
Hierarchical hashing: when we want to have a single hash that represents a given
structure (independent + combined), more efficient since the chunks are hash values.

Anteprima parziale del testo

Scarica Blockchain - Hash functions e più Appunti in PDF di Informatica solo su Docsity!

Hash functions : small computer programs which transform any kind of data into a string of fixed length, regardless the size of input data (many-to-one function). The number of possible inputs is larger than the number of possible outputs. Cryptographic hash functions: 3 properties :

  1. Preimage resistance: it is computationally infeasible to calculate any preimage x of a given y (H(x)=y)
  2. Second presage resistance: it is computationally infeasible to find a different input string x′ such that H(x) = H(x′)
  3. Collision resistance: it is computationally infeasible to find a pair of distinct input strings x, x′ such that H(x) = H(x′)
  • Deterministic: identical hash values for identical input data;
  • Pseudorandom: the hash value returned by the hash function changes (pseudo) randomly when the input data are changed. Requirement to be a “good” hash function: the relation between the input bit string x and the output bit string y should be complicated to prevent easy recovery of x from y. SHA-256 (Secure Hash Algorithm): 256 bits in the output, 2^64 - 1 bits in the input. No formal proof that it is a cryptographic hash function, but it has no known weaknesses. What if we have to provide one unique hash value for several independent data? You can’t use a hash function directly: the idea is to build structures made by hash functions. Different patterns : Independent hashing; Repeated hashing: apply the hash function to the output of the step before; Combined hashing: combine all the single data into one and then apply the hash function, since it is computationally intensive use this method with small data; Sequential hashing: incremental update of a hash value as new data arrives (combined + repeated), useful if we want a single updated hash value; Hierarchical hashing: when we want to have a single hash that represents a given structure (independent + combined), more efficient since the chunks are hash values.