From 4daf8ceba7ee416a0232cb199d12285d5453fc58 Mon Sep 17 00:00:00 2001 From: whx Date: Wed, 5 Apr 2023 19:45:15 +0200 Subject: [PATCH] bump --- Cryptography/RSA.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Cryptography/RSA.md b/Cryptography/RSA.md index ce224d7..5a33742 100644 --- a/Cryptography/RSA.md +++ b/Cryptography/RSA.md @@ -2,10 +2,21 @@ * `p * q = n` * Coprime Phi is calculated either by [Euler Totient](https://en.wikipedia.org/wiki/Euler's_totient_function) or [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) via [euclidean algorithm](https://crypto.stanford.edu/pbc/notes/numbertheory/euclid.html) -* \\(1 < $\phi$ < n \\) -* There is also $\phi$ = (p-1) * (q-1) -* Encryption, public key `e` is a prime between 2 and phi --> \\( 2 < e < $\phi$ \\) +$$ +1 < $\phi$ < n +$$ + +* There is also +$$ +$\phi$ = (p-1) * (q-1) +$$$ + +* Encryption, public key `e` is a prime between 2 and phi +$$ +2 < e < $\phi$ +$$ + ```python possible_e = [] for i in range (2, phi): @@ -13,7 +24,11 @@ for i in range (2, phi): possible_e.append() ``` -* Decryption, private key `d` --> \\( d * e mod $\phi$ = 1 \\) +* Decryption, private key `d` +$$ +d * e mod $\phi$ = 1 +$$ + ```python possible_d = [] for i in range (phi + 1, phi + foo):