# Lecture

# Hashing and Signatures

- A practical guide to two of the most important cryptographic primatives!

# Slides

# Ch1.1 Overview

## Cryptographic Hashes

What is a cryptographic hash?

- data (preimage) => hash function => unique output (hash)

Preimage Resistance:

- Given the output of a hash function (hash) you cannot determine the input data to that hash function (preimage)

2nd Preimage Resistance (aka Collision Resistance):

- A hash cannot have more than 1 preimage - each piece of data produces a unique hash

Random Oracle:

- A hash has no statistical correlation to the input data that created it (aka it looks like random data)

## Cryptographic Signatures

What is a cryptographic signature?

- A mathematical way to prove that a signer signed something

Public/Private Keys:

- Public key is like an address/username
- Private key is like a password/signature

Signature Functions:

- Allows you to sign stuff with your keys
- This also allows other people to verify that you did or did not sign something

Verification Functions:

- If you have a hash you can check that against a message (data), message signature, and public key of the signer to determine if that key signed that message. This is used to prove that X person signed Y document. If someone tries to change the document or the signature, the hash will be completely different.

# Recommended Resources

Crptographic Hash Functions

- SHA256 Hash App - Whatever you type into the box is instantly hashed via the SHA256 algorithm.
- Wikipedia - Everything you could ever want to know about hash functions.

Cryptographic Signatures

- Anders Brownworth's blockchain demos - Videos explaining (and showing) hash functions and signatures in more detail.
- Wikipedia - Everything you could ever want to know about digital (and cryptographic) signatures.