Sei sulla pagina 1di 12

Can you trust a

system without
trusting the
people?

Hashing the way to security


Introduction

➢ Hash functions and SHA

➢ Short history of SHA

➢ Application of Hash functions

○ Non-Cryptographic Hash functions

○ Cryptographic Hash functions

➢ Why do we need cryptographic hash functions?


Protocol for Message Authentication using
hash functions

Alice Bob
Plaintext x
y=E(x)
z=kpr(h(x)) (y,z)
x’=D(y)
z’=kpub(z)
If z’==h(x’):
Message is authentic
SHA-256

SHA-2 algorithm can be described in two stages: preprocessing and hash


computation.

1. Preprocessing involves padding a message, parsing the padded message into 512-bit
blocks.

l + k + 1 + 64 mod 512 = 0
The number l
l bits 1 bit k bits 64 bits written in
binary

10110000101011001100101….010101101 0000….000 101110101


1
010101 0 01

2. Setting initialization values to be used in the hash computation: K0 to K64, A0 to H0


SHA-256

Ai Bi Ci Di Ei Fi Gi Hi

Wi
Ki
+
T1
T2
+
T1 +
Ai+1 Bi+1 Ci+1 Di+1 Ei+1 Fi+1 Gi+1 Hi+1
SHA-256

Ai Bi Ci Di Ei Fi Gi Hi

𝚺0 𝚺1 +
+ fmaj
fmaj + Wi
+ Ki
+ + +
Ai+1 Bi+1 Ci+1 Di+1 Ei+1 Fi+1 Gi+1 Hi+1
SHA-256
Application-Cryptocurrency

● Cryptocurrency is a digital asset designed to work as a medium of


exchange.
● It is not backed by physical money.
● It is decentralized.

Problems that can come in a decentralized system:

● How do you prevent double-spending frauds?


● How can we trust a transaction without a trustworthy financial third
party institution?
Proof of Work

Block chain
Cryptographic Puzzle
Proof of Work

u t e
r
B rce
Proof of Work

● Both computationally feasible yet expensive to do, but inexpensive to


check.
● No one person can cheat the system: massively coordinated attacks
needed.
● Wanting to change one single transaction would require changing every
block downstream of that transaction
● “Trust” - The longest chain is the most trustworthy
● “Difficulty” changes with number of participants involved - 1 winner
every 10 minutes.
● Current hashrate(bitcoin) - 44,078,986 TH/s = 4.4 x 1019 H/s ~ 265 H/s
References

1. Understanding Cryptography, Cristophef Paar, Jan Pelzi


2. On the Secure Hash Algorithm family, Wouter Penard, Tim
van Werkhoven.
3. Bitcoin: A Peer-to-Peer Electronic Cash System, Satoshi
Nakamoto
4. ‘Ever wondered how Bitcoin (and other cryptocurrencies)
work?’ by 3Blue1Brown

Potrebbero piacerti anche