From 92728599a8b03dc36c6a2eacc6ae3a65b5b114cf Mon Sep 17 00:00:00 2001 From: whx Date: Mon, 14 Nov 2022 22:51:12 +0100 Subject: [PATCH] updated rsa --- Cryptography/RSA.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Cryptography/RSA.md b/Cryptography/RSA.md index 66c4f5d..bf68040 100644 --- a/Cryptography/RSA.md +++ b/Cryptography/RSA.md @@ -24,6 +24,20 @@ for i in range (phi + 1, phi + foo): * \\( Cleartext = cipher ** e mod $\phi$ ) ## Euklid + +Just a short excourse: +A greatest common divisior out of an example a = 32 and b = 14 would be the groups of the following divisors +```sh +a = 32, b = 24 +a = {1, 2, 4, 8, 16} +b = {1, 2, 3, 8, 12} +gcd(a,b) = 8 +``` + +### Greatest Common Divisor (GCD) + +Two values are prime and have themselves and only `1` as a divisor are called coprime. +To check if a and b have a greatest common divisor do the euclidean algorithm. ```python def gcd(a, b): if b == 0: @@ -31,6 +45,12 @@ def gcd(a, b): return gcd(b, a % b) ``` +### Extended GCD + +#TODO + + ## Links * [Encryption+Decryption](https://www.cs.drexel.edu/~jpopyack/Courses/CSP/Fa17/notes/10.1_Cryptography/RSA_Express_EncryptDecrypt_v2.html) +* [Extended GCD](http://www-math.ucdenver.edu/~wcherowi/courses/m5410/exeucalg.html)