This commit is contained in:
Zheyuan Wu
2024-12-07 15:33:14 -06:00
parent 94817e8381
commit f5f0e2a5c3
10 changed files with 203 additions and 100 deletions

View File

@@ -1 +0,0 @@
# Lecture 12

View File

@@ -1 +0,0 @@
# Lecture 13

View File

@@ -1 +0,0 @@
# Lecture 14

View File

@@ -1 +0,0 @@
# Lecture 15

View File

@@ -4,27 +4,15 @@ export default {
type: 'separator'
},
Exam_reviews: "Exam reviews",
CSE347_L1: "Lecture 1",
CSE347_L2: "Lecture 2",
CSE347_L3: "Lecture 3",
CSE347_L4: "Lecture 4",
CSE347_L5: "Lecture 5",
CSE347_L6: "Lecture 6",
CSE347_L7: "Lecture 7",
CSE347_L8: "Lecture 8",
CSE347_L9: "Lecture 9",
CSE347_L10: "Lecture 10",
CSE347_L11: "Lecture 11",
CSE347_L12: {
display: 'hidden'
},
CSE347_L13: {
display: 'hidden'
},
CSE347_L14: {
display: 'hidden'
},
CSE347_L15: {
display: 'hidden'
}
}
CSE347_L1: "Analysis of Algorithms (Lecture 1)",
CSE347_L2: "Analysis of Algorithms (Lecture 2)",
CSE347_L3: "Analysis of Algorithms (Lecture 3)",
CSE347_L4: "Analysis of Algorithms (Lecture 4)",
CSE347_L5: "Analysis of Algorithms (Lecture 5)",
CSE347_L6: "Analysis of Algorithms (Lecture 6)",
CSE347_L7: "Analysis of Algorithms (Lecture 7)",
CSE347_L8: "Analysis of Algorithms (Lecture 8)",
CSE347_L9: "Analysis of Algorithms (Lecture 9)",
CSE347_L10: "Analysis of Algorithms (Lecture 10)",
CSE347_L11: "Analysis of Algorithms (Lecture 11)"
}

View File

@@ -10,7 +10,9 @@ $$
Adversary knows $c$, but nothing else.
### Known plaintext attack (KPA)
### Attack models
#### Known plaintext attack (KPA)
Adversary has seen $(m_1,Enc_k(m_1)),(m_2,Enc_k(m_2)),\cdots,(m_q,Enc_k(m_q))$.
@@ -18,7 +20,7 @@ $m_1,\cdots,m_q$ are known to the adversary.
Given new $c=Enc_k(m)$, is previous knowledge helpful?
### Chosen plaintext attack (CPA)
#### Chosen plaintext attack (CPA)
Adversary can choose $m_1,\cdots,m_q$ and obtain $Enc_k(m_1),\cdots,Enc_k(m_q)$.
@@ -32,35 +34,24 @@ So US use Axis: $Enc_k(AF)$ and ran out of supplies.
Then US know Japan will attack Midway.
### Chosen ciphertext attack (CCA)
#### Chosen ciphertext attack (CCA)
Adversary can choose $c_1,\cdots,c_q$ and obtain $Dec_k(c_1),\cdots,Dec_k(c_q)$.
#### Definition 168.1 (Secure private key encryption against attacks)
Capture these ideas with the adversary having oracle access.
$$
\Pi=(Gen,Enc,Dec)
$$
Let $\Pi=(Gen,Enc,Dec)$ be a private key encryption scheme. Let a random variable $IND_b^{O_1,O_2}(\Pi,\mathcal{A},n)$ where $\mathcal{A}$ is an n.u.p.p.t. The security parameter is $n\in \mathbb{N}$, $b\in\{0,1\}$ denoting the real scheme or the adversary's challenge.
private key encryption scheme.
$$
IND_b^{O_1,O_2}(\Pi,\mathcal{A},n)
$$
where $O_1$ and $O_2$ are the round 1 and round 2 oracle access.
$b$ is zero or one denoting the real scheme or the adversary's challenge.
$n$ is the security parameter.
is the following experiment:
The experiment is the following:
- Key $k\gets Gen(1^n)$
- Adversary $\mathcal{A}^{O_1(k)}(1^n)$ queries oracles
- $m_0,m_1\gets \mathcal{A}^{O_2(k)}(1^n)$
- Adversary $\mathcal{A}^{O_1(k)}(1^n)$ queries oracle $O_1$
- $m_0,m_1\gets \mathcal{A}^{O_1(k)}(1^n)$
- $c\gets Enc_k(m_b)$
- $\mathcal{A}^{O_2(c)}(1^n,c)$ queries oracles
- $\mathcal{A}^{O_2(c)}(1^n,c)$ queries oracle $O_2$ to distinguish $c$ is encryption of $m_0$ or $m_1$
- $\mathcal{A}$ outputs bit $b'$ which is either zero or one
$\Pi$ is CPA/CCA1/CCA2 secure if for all PPT adversaries $\mathcal{A}$,
@@ -79,9 +70,75 @@ where $\approx$ is statistical indistinguishability.
Note that $Dec_k^*$ will not allowed to query decryption of a functioning ciphertext.
You can imagine the experiment is a class as follows:
```python
n = 1024
@lru_cache(None)
def oracle_1(m,key,**kwargs):
"""
Query oracle 1
"""
pass
@lru_cache(None)
def oracle_2(c,key,**kwargs):
"""
Query oracle 2
"""
pass
class Experiment:
def __init__(self, key, oracle_1, oracle_2):
self.key = key
self.oracle_1 = oracle_1
self.oracle_2 = oracle_2
def sufficient_trial(self):
pass
def generate_test_message(self):
pass
def set_challenge(self, c):
self.challenge = c
def query_1(self):
while not self.sufficient_trial():
self.oracle_1(m,self.key,**kwargs)
def challenge(self):
"""
Return m_0, m_1 for challenge
"""
m_0, m_1 = self.generate_test_message()
self.m_0 = m_0
self.m_1 = m_1
return m_0, m_1
def query_2(self, c):
while not self.sufficient_trial():
self.oracle_2(c,self.key,**kwargs)
def output(self):
return 0 if self.challenge==m_0 else 1
if __name__ == "__main__":
key = random.randint(0, 2**n)
exp = Experiment(key, oracle_1, oracle_2)
exp.query_1()
m_0, m_1 = exp.challenge()
choice = random.choice([m_0, m_1])
exp.set_challenge(choice)
exp.query_2()
b_prime = exp.output()
print(f"b'={b_prime}, b={choice==m_0}")
```
#### Theorem: Our mms private key encryption scheme is CPA, CCA1 secure.
Have a PRF family $\{f_k\}:\{0,1\}^|k|\to\{0,1\}^{|k|}$
Have a PRF family $\{f_k\}:\{0,1\}^{|k|}\to\{0,1\}^{|k|}$
$Gen(1^n)$ outputs $k\in\{0,1\}^n$ and samples $f_k$ from the PRF family.

View File

@@ -4,28 +4,28 @@ export default {
type: 'separator'
},
Exam_reviews: "Exam reviews",
CSE442T_L1: "Lecture 1",
CSE442T_L2: "Lecture 2",
CSE442T_L3: "Lecture 3",
CSE442T_L4: "Lecture 4",
CSE442T_L5: "Lecture 5",
CSE442T_L6: "Lecture 6",
CSE442T_L7: "Lecture 7",
CSE442T_L8: "Lecture 8",
CSE442T_L9: "Lecture 9",
CSE442T_L10: "Lecture 10",
CSE442T_L11: "Lecture 11",
CSE442T_L12: "Lecture 12",
CSE442T_L13: "Lecture 13",
CSE442T_L14: "Lecture 14",
CSE442T_L15: "Lecture 15",
CSE442T_L16: "Lecture 16",
CSE442T_L17: "Lecture 17",
CSE442T_L18: "Lecture 18",
CSE442T_L19: "Lecture 19",
CSE442T_L20: "Lecture 20",
CSE442T_L21: "Lecture 21",
CSE442T_L22: "Lecture 22",
CSE442T_L23: "Lecture 23",
CSE442T_L24: "Lecture 24"
CSE442T_L1: "Introduction to Cryptography (Lecture 1)",
CSE442T_L2: "Introduction to Cryptography (Lecture 2)",
CSE442T_L3: "Introduction to Cryptography (Lecture 3)",
CSE442T_L4: "Introduction to Cryptography (Lecture 4)",
CSE442T_L5: "Introduction to Cryptography (Lecture 5)",
CSE442T_L6: "Introduction to Cryptography (Lecture 6)",
CSE442T_L7: "Introduction to Cryptography (Lecture 7)",
CSE442T_L8: "Introduction to Cryptography (Lecture 8)",
CSE442T_L9: "Introduction to Cryptography (Lecture 9)",
CSE442T_L10: "Introduction to Cryptography (Lecture 10)",
CSE442T_L11: "Introduction to Cryptography (Lecture 11)",
CSE442T_L12: "Introduction to Cryptography (Lecture 12)",
CSE442T_L13: "Introduction to Cryptography (Lecture 13)",
CSE442T_L14: "Introduction to Cryptography (Lecture 14)",
CSE442T_L15: "Introduction to Cryptography (Lecture 15)",
CSE442T_L16: "Introduction to Cryptography (Lecture 16)",
CSE442T_L17: "Introduction to Cryptography (Lecture 17)",
CSE442T_L18: "Introduction to Cryptography (Lecture 18)",
CSE442T_L19: "Introduction to Cryptography (Lecture 19)",
CSE442T_L20: "Introduction to Cryptography (Lecture 20)",
CSE442T_L21: "Introduction to Cryptography (Lecture 21)",
CSE442T_L22: "Introduction to Cryptography (Lecture 22)",
CSE442T_L23: "Introduction to Cryptography (Lecture 23)",
CSE442T_L24: "Introduction to Cryptography (Lecture 24)"
}

View File

@@ -4,29 +4,29 @@ export default {
type: 'separator'
},
Exam_reviews: "Exam reviews",
Math4111_L1: "Lecture 1",
Math4111_L2: "Lecture 2",
Math4111_L3: "Lecture 3",
Math4111_L4: "Lecture 4",
Math4111_L5: "Lecture 5",
Math4111_L6: "Lecture 6",
Math4111_L7: "Lecture 7",
Math4111_L8: "Lecture 8",
Math4111_L9: "Lecture 9",
Math4111_L10: "Lecture 10",
Math4111_L11: "Lecture 11",
Math4111_L12: "Lecture 12",
Math4111_L13: "Lecture 13",
Math4111_L14: "Lecture 14",
Math4111_L15: "Lecture 15",
Math4111_L16: "Lecture 16",
Math4111_L17: "Lecture 17",
Math4111_L18: "Lecture 18",
Math4111_L19: "Lecture 19",
Math4111_L20: "Lecture 20",
Math4111_L21: "Lecture 21",
Math4111_L22: "Lecture 22",
Math4111_L23: "Lecture 23",
Math4111_L24: "Lecture 24",
Math4111_L25: "Lecture 25"
Math4111_L1: "Introduction to Real Analysis (Lecture 1)",
Math4111_L2: "Introduction to Real Analysis (Lecture 2)",
Math4111_L3: "Introduction to Real Analysis (Lecture 3)",
Math4111_L4: "Introduction to Real Analysis (Lecture 4)",
Math4111_L5: "Introduction to Real Analysis (Lecture 5)",
Math4111_L6: "Introduction to Real Analysis (Lecture 6)",
Math4111_L7: "Introduction to Real Analysis (Lecture 7)",
Math4111_L8: "Introduction to Real Analysis (Lecture 8)",
Math4111_L9: "Introduction to Real Analysis (Lecture 9)",
Math4111_L10: "Introduction to Real Analysis (Lecture 10)",
Math4111_L11: "Introduction to Real Analysis (Lecture 11)",
Math4111_L12: "Introduction to Real Analysis (Lecture 12)",
Math4111_L13: "Introduction to Real Analysis (Lecture 13)",
Math4111_L14: "Introduction to Real Analysis (Lecture 14)",
Math4111_L15: "Introduction to Real Analysis (Lecture 15)",
Math4111_L16: "Introduction to Real Analysis (Lecture 16)",
Math4111_L17: "Introduction to Real Analysis (Lecture 17)",
Math4111_L18: "Introduction to Real Analysis (Lecture 18)",
Math4111_L19: "Introduction to Real Analysis (Lecture 19)",
Math4111_L20: "Introduction to Real Analysis (Lecture 20)",
Math4111_L21: "Introduction to Real Analysis (Lecture 21)",
Math4111_L22: "Introduction to Real Analysis (Lecture 22)",
Math4111_L23: "Introduction to Real Analysis (Lecture 23)",
Math4111_L24: "Introduction to Real Analysis (Lecture 24)",
Math4111_L25: "Introduction to Real Analysis (Lecture 25)"
}

View File

@@ -0,0 +1,62 @@
# Math 4111
This is a course about real analysis.
Topics include:
1. Number Theory
2. Basic topology and set theory
3. Sequences and Series
4. Convergence of Series and Sequences
5. Limits and Continuity
The course is taught by [Alan Chang](https://math.wustl.edu/people/alan-chang).
It is easy in my semester perhaps, it is the first course I got 3 perfect scores in exams. (Unfortunately, I did not get the extra credit for the third midterm exam.)
<!--
## Midterms stats
Our semester is way more easier than the previous ones. The previous ones got median scores of 25.
Stats for first midterm:
| |out of|avg|stddev|25th|50th|75th|
|--|--|--|--|--|--|--|
|total|50|40.7|9.9|37.0|45.0|48.0|
|1a|10|9.3|2.0|10.0|10.0|10.0|
|1b|10|8.3|2.4|6.8|9.0|10.0|
|2a|10|7.5|3.1|6.0|8.0|10.0|
|2b|10|6.9|3.4|4.0|8.0|10.0|
|3|10|8.8|2.4|9.0|10.0|10.0|
I skipped the last half hour, still get 50. I can't believe how easy it is compared to homework assignments.
Stats for second midterm:
| |out of|avg|stddev|25th|50th|75th|
|--|--|--|--|--|--|--|
|total|50.0|37.3|12.4|30.5|41.0|47.5|
|1|10|7.6|3.2|4.0|10.0|10.0|
|2|10|8.9|2.7|10.0|10.0|10.0|
|3|10|6.6|3.4|4.0|8.0|10.0|
|4a|10|6.6|4.1|2.0|9.0|10.0|
|4b|10|7.7|3.5|8.0|10.0|10.0|
I skipped the last half hour again, still get 50. But I felt this time is more challenging than the first one. Much like what Math is.
Stats for third midterm:
| |out of|avg|stddev|25th|50th|75th|
|--|--|--|--|--|--|--|
|total|50.0|37.2|10.1|31.0|40.0|44.8|
|1|10|8.2|3.1|7.0|10.0|10.0|
|2|10|8.2|2.5|7.0|10.0|10.0|
|3|10|7.1|3.0|6.0|6.0|10.0|
|4a|10|5.6|4.2|0.0|6.5|9.8|
|4b|10|8.1|3.4|6.5|10.0|10.0|
|5|0|0.0|0.1|0.0|0.0|0.0|
I got 50 and just barely made it. The third midterm is the hardest one. The extra credit question is way too hard and I only got few minutes to solve it.-->