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):