mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-26 06:14:06 -06:00
112 lines
3.0 KiB
Markdown
112 lines
3.0 KiB
Markdown
---
|
|
title: "06-hashing-binary-public-key-cryptography"
|
|
aliases:
|
|
tags:
|
|
- lecture
|
|
- comp210
|
|
sr-due: 2022-08-19
|
|
sr-interval: 3
|
|
sr-ease: 250
|
|
---
|
|
|
|
- 
|
|
|
|
# news
|
|
- pegasus project
|
|
- cutting internet cables
|
|
|
|
# Hash function
|
|
- yields a small, districtive value (hash or digest) from an arbitrarily sized input.
|
|
- one way function
|
|
- non-invertable
|
|
- uniform size (each ouput eqaully likely)
|
|
- deterministic (same input maps to same output)
|
|
- possibility of collisions (b-day paradox, potential attacks)
|
|
|
|
message => hash() => hash
|
|
|
|
also
|
|
- can be used for data structures
|
|
- [hash-map](notes/hash-map.md)
|
|
- lots of theory
|
|
- often use modular arithmetic
|
|
- usually have more complicated algorithms than mod
|
|
|
|
## in crypto
|
|
- needs to be
|
|
- impossible to reverse
|
|
- difficult to find collision
|
|
- uniform length output (tunable)
|
|
- must account for every bit of information in a message
|
|
- must be sensitive to changes input (avalancge effect)
|
|
- ouput should no contain apparent iinformation (appears random)
|
|
- easily computed (usually)
|
|
- for passowords should be slow
|
|
- makes brute force attacks take time
|
|
- key strechting (repeated application of hash)
|
|
- use complex memory access patterns to defeat esp
|
|
|
|
effectively a digital fingerprint;
|
|
|
|
## collision probability
|
|
|
|
$v = a^l$
|
|
|
|
- 
|
|
- 
|
|
- 
|
|
|
|
can also be used to compare complexity of passwords
|
|
- 
|
|
- should have about 80 bits of entropy
|
|
|
|
|
|
- 
|
|
|
|
## uses of hashing
|
|
- 
|
|
- 
|
|
|
|
## good algorithms
|
|
- 
|
|
- 
|
|
|
|
|
|
# One-time-pads
|
|
- basic idea
|
|
- generate single-use truly-random key they is at least as long as the plaintext
|
|
- combine the key with the plaintext using XOR one bit at a time
|
|
- resulting ciphertext looks like random noise
|
|
- decryption must use same key (symmetric)
|
|
|
|
## limitations
|
|
impossible to crack, if properly implemented.
|
|
- but key must be shared
|
|
- key distribution problem
|
|
- need long, truly random, one time keys
|
|
- must be used only once
|
|
|
|
# assymetric cryptography
|
|
uses different but mathematically related keys for encrption and decryption
|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|
|
|
|
|
# digital signatures
|
|
encryption + signing. signing verfies authenticity of sender
|
|
|
|

|
|

|
|
|
|
stream ciphers vs block ciphers
|
|
|
|
one bit at a time vs chunks
|
|
|
|
reciprocal cipher
|
|

|