diff --git a/pages/CSE347/CSE347_L12.md b/pages/CSE347/CSE347_L12.md deleted file mode 100644 index 6c6b1b2..0000000 --- a/pages/CSE347/CSE347_L12.md +++ /dev/null @@ -1 +0,0 @@ -# Lecture 12 \ No newline at end of file diff --git a/pages/CSE347/CSE347_L13.md b/pages/CSE347/CSE347_L13.md deleted file mode 100644 index 1282ee9..0000000 --- a/pages/CSE347/CSE347_L13.md +++ /dev/null @@ -1 +0,0 @@ -# Lecture 13 \ No newline at end of file diff --git a/pages/CSE347/CSE347_L14.md b/pages/CSE347/CSE347_L14.md deleted file mode 100644 index 873d41d..0000000 --- a/pages/CSE347/CSE347_L14.md +++ /dev/null @@ -1 +0,0 @@ -# Lecture 14 \ No newline at end of file diff --git a/pages/CSE347/CSE347_L15.md b/pages/CSE347/CSE347_L15.md deleted file mode 100644 index 56bee61..0000000 --- a/pages/CSE347/CSE347_L15.md +++ /dev/null @@ -1 +0,0 @@ -# Lecture 15 \ No newline at end of file diff --git a/pages/CSE347/_meta.js b/pages/CSE347/_meta.js index cf64ff0..73da9a7 100644 --- a/pages/CSE347/_meta.js +++ b/pages/CSE347/_meta.js @@ -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)" +} \ No newline at end of file diff --git a/pages/CSE442T/CSE442T_L22.md b/pages/CSE442T/CSE442T_L22.md index a0aef65..8d35328 100644 --- a/pages/CSE442T/CSE442T_L22.md +++ b/pages/CSE442T/CSE442T_L22.md @@ -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. diff --git a/pages/CSE442T/_meta.js b/pages/CSE442T/_meta.js index dbe16c5..172950f 100644 --- a/pages/CSE442T/_meta.js +++ b/pages/CSE442T/_meta.js @@ -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)" } diff --git a/pages/Math4111/_meta.js b/pages/Math4111/_meta.js index b30f12f..99ec735 100644 --- a/pages/Math4111/_meta.js +++ b/pages/Math4111/_meta.js @@ -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)" } diff --git a/pages/Math4111/index.md b/pages/Math4111/index.md index e69de29..99bbf15 100644 --- a/pages/Math4111/index.md +++ b/pages/Math4111/index.md @@ -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.) + + \ No newline at end of file diff --git a/pages/Math429/index.mdx b/pages/Math429/index.md similarity index 100% rename from pages/Math429/index.mdx rename to pages/Math429/index.md