Andreas Park PRO
Professor of Finance at UofT
Instructor: Andreas Park
UTM
Cryptography
Source: Cambridge Bitcoin Energy Consumption Index https://cbeci.org/
Definition
Takes a message/text of arbitrary length and generates a fixed length output or "digest"
Properties
Simple Application
What hashing functions are there
Demo time!
https://andersbrownworth.com/blockchain/
Why are hashing functions used in blockchain?
Problem: Hashes can be cracked!
cracked by "CrackStation"
Encryption
Alice wants to send Bob money without Charles seeing it
SYMMETRIC: Alice and Bob use the same key to
encrypt and decrypt a message
Public key = Private key
ASYMMETRIC: Bob has a public and a private key
Public
Private
Digital Signatures
Alice's private
Alice wants to send Bob message and provide proof that it's her
Alice's public
Uses
Types
Uses
Types
Quantum-resistant signatures???
Summary
The main cryptographic primitives
But it doesn't end here...
zk-SNARKS
Digital Signatures
Crypto Math
Example for "normal" or polynomial time:
Example for exponential time:
Examples of "Andreas"
Examples of "AnDrEaS"
Some formalism
Symmetric Encryption: Example
Letter | number | encoding |
---|---|---|
A | 0 | 3 |
B | 1 | 4 |
C | 2 | 5 |
... | ||
W | 21 | 25 |
X | 23 | 0 |
Y | 24 | 1 |
Z | 25 | 2 |
Formally
required property
if S applied to M created T, T=Sign(M,S) => Check(T,M,P)=1
Alice wants to send Bob a message and provide proof that its her.
Sa
Pa
formally: computes T=Sign(M,Sa)
formally: computes check(T,M,Pa)
n | |
---|---|
1 | 1 |
5 | 4 |
10 | 4 |
12 | 4 |
14 | 6 |
15 | 8 |
and now going backward:
so we have \(x=7\) and \(y=-17\) so that
\(1=x\cdot m+y\cdot n=7\cdot 175+(-17)\cdot 72\)
Ingredients for encryption
What do we want to do?
What do we send?
How do you decrypt?
Calculate \({\tilde{w}_i}^x\text{ mod } n.\)
Sa
Pa
S=(x,n)=(2011,3127)
P=(e,n)=(3,3127)
for greater satisfaction, the formal argument for the encrypter
(assumes \(n\) is large and \(w\) small)
this step uses Euler's theorem
Sa
Pa
S=(x,n)=(2011,3127)
P=(e,n)=(3,3127)
Example parameters
By Andreas Park
This is the slide deck that I use for a quick introduction to the Decentralized Finance class.