From ace089060f5340c3bb7e79c36e80998e5ec67fb4 Mon Sep 17 00:00:00 2001 From: shwetha729 Date: Fri, 18 Aug 2023 19:30:13 -0400 Subject: [PATCH] Friday, August 18, 2023, 19:30:01 + 6 --- enter/.obsidian/workspace.json | 29 ++++++------ .../Terminal Tips/Languages/LaTeX.md | 9 +++- enter/Proof of a formula for modulo.md | 44 +++++++++++++++++++ 3 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 enter/Proof of a formula for modulo.md diff --git a/enter/.obsidian/workspace.json b/enter/.obsidian/workspace.json index 733d010..854d76b 100644 --- a/enter/.obsidian/workspace.json +++ b/enter/.obsidian/workspace.json @@ -59,7 +59,7 @@ "state": { "type": "markdown", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Servers/Physical Servers/Raspberry Pis.md", + "file": "Proof of a formula for modulo.md", "mode": "source", "source": false } @@ -95,7 +95,7 @@ "state": { "type": "search", "state": { - "query": "PWA", + "query": "latex", "matchingCase": false, "explainSearch": false, "collapseAll": false, @@ -116,7 +116,8 @@ } ], "direction": "horizontal", - "width": 332.5 + "width": 332.5, + "collapsed": true }, "right": { "id": "5fd977257f812825", @@ -132,7 +133,7 @@ "state": { "type": "backlink", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Servers/Physical Servers/Raspberry Pis.md", + "file": "Proof of a formula for modulo.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -149,7 +150,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Servers/Physical Servers/Raspberry Pis.md", + "file": "Proof of a formula for modulo.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -172,7 +173,7 @@ "state": { "type": "outline", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Servers/Physical Servers/Raspberry Pis.md" + "file": "Proof of a formula for modulo.md" } } } @@ -196,8 +197,15 @@ "omnisearch:Omnisearch": false } }, - "active": "821695a40daeadc2", + "active": "232b6fc149c4f16b", "lastOpenFiles": [ + "Coding Tips (Classical)/Terminal Tips/Servers/Physical Servers/Raspberry Pis.md", + "Proof of a formula for modulo.md", + "Coding Tips (Classical)/Terminal Tips/Languages/LaTeX.md", + "Machine Tips (Quantum)/Math/Visualizing the Quantum Space.md", + "Machine Tips (Quantum)/Math/Quantum Formalism.md", + "Machine Tips (Quantum)/Math/Math terms & Probabilities.md", + "Machine Tips (Quantum)/Math/Math Software.md", "Coding Tips (Classical)/Terminal Tips/Servers/Virtual Machines/About Virtual Machines.md", "Coding Tips (Classical)/Terminal Tips/Servers/Virtual Machines/Connect to a VirtualBox VM desktop remotely.md", "Coding Tips (Classical)/Terminal Tips/Servers/About Servers.md", @@ -221,16 +229,9 @@ "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian Guides/Obsidian-net process.md", "Machine Tips (Quantum)/Physics/Hardware/MicroControllers/Arduino.md", "Coding Tips (Classical)/Terminal Tips/CLI Tools/Networking/Protocols/APIs/Useful APIs.md", - "Machine Tips (Quantum)/Resources/Quantum 101 - Alt. Resources.md", - "Machine Tips (Quantum)/Math/Algorithms/Encryption/Encryption Software.md", - "Machine Tips (Quantum)/Resources/Welcome to Quantum 101.md", "Machine Tips (Quantum)/Quantum spaces.canvas", "Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230817142703.png", - "Coding Tips (Classical)/Webpage/Resume-ish - my occupations.md", - "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian Guides/Digital Garden Plugin.md", "Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230817143911.png", - "Coding Tips (Classical)/Terminal Tips/About terminal.md", - "Machine Tips (Quantum)/Resources/Technologies, Orgs, & Apps/Intro to Quantum Technologies.md", "Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230817040651.png", "Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230816174402.png", "Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230816173235.png", diff --git a/enter/Coding Tips (Classical)/Terminal Tips/Languages/LaTeX.md b/enter/Coding Tips (Classical)/Terminal Tips/Languages/LaTeX.md index b32c668..a5c6bc0 100644 --- a/enter/Coding Tips (Classical)/Terminal Tips/Languages/LaTeX.md +++ b/enter/Coding Tips (Classical)/Terminal Tips/Languages/LaTeX.md @@ -71,4 +71,11 @@ We start by defining the document-class But you may be better off editing a document simply through [Overleaf](https://www.overleaf.com/project/6306feb35a99fd317a79ec3a) as well. -![[Pasted image 20220825004820.png]] \ No newline at end of file +![[Pasted image 20220825004820.png]] + + +## Latex Cheatsheet: +--- +- use `\` for spaces if not already handles +- for the Obsidian plugin use `$$` to enable +- for multi-integer exponentiation use `a^{34 + 65}` \ No newline at end of file diff --git a/enter/Proof of a formula for modulo.md b/enter/Proof of a formula for modulo.md new file mode 100644 index 0000000..160c5d4 --- /dev/null +++ b/enter/Proof of a formula for modulo.md @@ -0,0 +1,44 @@ + + + +$$16^{54} \ mod \ 17=3^{24×54} \ mod \ 17 $$ + +Why? + +[Public Key Cryptography: Diffie-Hellman Key Exchange (short version) - YouTube](https://www.youtube.com/watch?v=3QnD2c4Xovk) is a good video to understand asymmetric cryptography. There is a jump from 4:34 in the video that is not obvious to everyone. + +The jump is from 1654mod17 to 324×54mod17, but why? From the comments of video, I’m not the only one who is supprised by this jump. + +First let me introduce a formula: + +$$a^b\ mod \ p=((a \ mod \ p)^b) \ mod \ p \ \ \ \ (1)$$ + +Then the proof: + +There must be one integer `n` to have + +$$a \ mod \ p=a−np \ \ \ \ (2)$$ + +so + +$$((a \ mod \ p)^b) \ mod \ p=((a−np)^b) \ mod \ p$$ + +With [Binomial theorem - Wikipedia](https://en.wikipedia.org/wiki/Binomial_theorem), + +$$(a−np)b=ab+(b1)ab−1(−np)+(b2)ab−2(−np)2+...+(−np)b$$ + +We could see that all items are times of `p` except $a^b$, + +$$((a−np)bmodp)=(ab+(b1)ab−1(−np)+(b2)ab−2(−np)2+...+(−np)b)modp=abmodp+0+0+...+0$$ + +Now we got + +$$((a−np)^b \ mod \ p)=a^b \ mod \ p$$ + +Use formula (2) + +$$((amodp)b)modp=abmodp$$ + +Now let a as $3^{24}$, and b as 54 in formula (1): + +$$3^{24×54}\ mod \ 17=((3^{24})^{54}) \ mod \ 17=((324mod17)54)mod17=1654mod17$$ \ No newline at end of file