Cryptography is the practice of secure communication in an adversarial environment, with some encoding and decoding. Encryption is the process of transforming information in a way that (ideally) only authorised parties can decode, such that an intercepted message can’t be decoded.
We define:
- : encryption of a message to .
- : decryption of an encrypted message .
Basics
There are two main types of encryption. Symmetric encryption proposes that both parties agree on a single key. The sender has a plaintext message and uses the key to encrypt, then transmits it. The receiver then uses the same key to decrypt the message.
Obvious problem: what if the sender/receiver don’t meet physically? How do you securely exchange the key?
In asymmetric encryption, we use two keys: a public and private key. Hence, we also call this public-key cryptography. Here, the sender and receiver both have a set of public and private keys. A private key is possessed only by a single person. Here, the communication workflow is different:
- The sender signs the message with the public key of the receiver, then encrypts and sends the message.
- The receiver decrypts the message with their private key.
Unsorted notes
from special lecture by Prof Veneris
how to generate key pairs?
- relies on cryptography, essentially number theory. relies on idea that Prime factorisation is very difficult
RSA:
- select two very large primes (over 1000 bits; RSA with ~700 bits has been cracked already)
- compute
- compute
- select small odd integer , relative prime to
- compute such that , i.e., modulo fn == 1
- keys
- public key
- secret key
- basically: too large. so very hard to invert operation
- but RSA no longer really used, use elliptic curve cryptography
- vs Bitcoin
- bitcoin has no programmability, based on a simple stack language
- Ethereum written in Solidity, based on JavaScript
- Smart contract
- Ethereum guarantees execution of the contract
- as a Finite state machine
- idea: charge per computation
- trustless computer, all miners have to agree on state transitions
criticisms
- power: Bitcoin consumes a shit ton of power, more than the country of Austria consumes. Ethereum also has same problem
- proof of stake — stake down your own ether, verify transactions? idk
- scalability
- per network
- bitcoin: 3-7 trans/sec
- eth: ~20
- visa: 2000, can hit 20k at peak
- paypal: 200
- L1 network: Ethereum, bitcoin
- L2 network: slightly separate, aggregate transactions, register back to L1 network
- but not necessarily secure or decentralised
- per network
decentralised finance v centralised finance
- DeFi vs CeFi
- centralised: what we have now. idea: allows middlemen fees (ex with foreign currency exchanges), has delays (foreign transfers)
- decentralised: transparent, on chain. assets can be traded with absolute transparency
central bank digital currencies
- or just digital currencies
- like in China
- most govts studying them