From ec2dc062edfd94bf278edab8ab1ac92a3d29ec7a Mon Sep 17 00:00:00 2001 From: d Date: Fri, 26 Jan 2024 09:02:33 +0100 Subject: [PATCH 01/16] Added a section for the RSA standard algorithm with an example to follow --- Cryptography/readme.md | 69 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 3a3f043b..57233a68 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -34,12 +34,79 @@ Hash functions are used to map data of arbitrary size to data of fixed size. The 3. [Playfair Cipher](notadded) 4. [DES](notadded) 5. [AES](notadded) -6. [RSA](notadded) +6. [RSA](##RSA (Rivest-Shamir-Adleman)) 7. [Diffie-Hellman Key Exchange](notadded) 8. [ElGamal](notadded) 9. [Digital Signature Algorithm](notadded) 10. [Elliptic Curve Cryptography](notadded) +## RSA (Rivest-Shamir-Adleman) +**IMPORTANT NOTE**: + 1. Do not implement techniques like these yourself in an enviroment, that can hurt you in any kind of way. + 2. The shown RSA method is already broken! This guide aims to give you a basic understanding of the algorithm. +Broken down, the RSA method is nothing more than the multiplicative inverse within a residue class ring. +This means that the task is to find an inverse modulo the Eulerian phi function of a high integer n that is difficult to compute. +This proves to be particularly difficult to do, as even computers have difficulties with the calculation algorithm above a certain length. +### Step 1: Finding n +To avoid this when generating the key, the n is chosen so that it is the product of two high prime numbers. This has the advantage that simple mathematical rules can be applied to determine the Phi of the product n. +The property that prime numbers and the Phi function share is that they are divisors of all numbers (except 1, but this does not play a role in the Phi function either) and therefore Phi of a prime number p is equal to p-1. +If you now want to determine the Phi of the product, you can simply multiply the prime numbers p and q as follows: $\Phi(n)=\Phi(p)*\Phi(q)=(p-1)*(q-1)$. +With this step, we have now determined our n and the phi of n. + +### Step 2: Finding e +The next step is to search for our encryption exponent e. This is used to encrypt the message we are transmitting. +The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. +The following steps must be observed when choosing a suitable e: + 1. $1 < e < \Phi(n)$ + 2. $GCD(e, \Phi(n)) = 1$ +This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. +A frequently used e is 65537, which is $2^{16}+1$ and a prime number. + +Now we have our public key composed of n and e and can encrypt messages m as follows: $cipher\,c=m^e\,mod\,n$ + +### Step 3: Private Key +As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. +So there is nothing more to do than to calculate $d=e^{-1}\,mod\,\Phi(n)$. +We have to do this using the extended Euclidean algorithm, for which there are various approaches. + +To decrypt a received ciphertext, we have to exponentiate it with our private key: $m'=c^d\,mod\,n$ + +### Example +In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. +We are given the prime numbers $p=23$ and $q=31$. Our n is therefore $n=p*q=23*31=713$. +#### Step 1: $\Phi(n)$ +As shown above, we do a simple calculation: +$\Phi(n)=\Phi(p)*\Phi(q)=(p-1)*(q-1)=30*22=660$ + +#### Step 2: Encryption exponent e +I have chosen a small value for demonstration purposes. +Let $e=7$ +We can now show that the above rules are observed: +1. $1<7<660$ +2. $GCD(7,660)=1$ + +#### Step 3: Decryption exponent d +As already mentioned above, there are various techniques for applying the extended Euclidean algorithm. +In the example, a table form is used in which the following formulae apply: +1. $a_{i+1}=b_i$ +2. $b_{i+1}=r_i$ +3. $x_i=y_{i+1}$ +4. $y_i=x_{i+1}-q_i*x_i$ +5. $x_n=0$ ^ $y_n=1$ + +We remember that the decryption exponent is calculated as follows: $d=e^{-1}\,mod\,\Phi(n)$ + +We determine this as follows: + +| i | a | b | q | r | x | y | +|---|-----|---|----|---|----|-----| +| 1 | 660 | 7 | 94 | 2 | -3 | 283 | +| 2 | 7 | 2 | 3 | 1 | 1 | -3 | +| 3 | 2 | 1 | 2 | 0 | 0 | 1 | + +The procedure is quite simple. We calculate our $\Phi(n)$ modulo our e and work our way down from there until we have a remainder of 0. Until then, x and y remain empty. +When we have the remainder 0, we insert the standard values for x and y and work our way up again from below + __NOTE__: ``` 1. *RSA* means Rivest–Shamir–Adleman. From 6b2b00159ef370abc484cd978bebb21f56b472f9 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:04:58 +0100 Subject: [PATCH 02/16] Format --- Cryptography/readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 57233a68..4c21441e 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -57,8 +57,10 @@ With this step, we have now determined our n and the phi of n. The next step is to search for our encryption exponent e. This is used to encrypt the message we are transmitting. The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. The following steps must be observed when choosing a suitable e: - 1. $1 < e < \Phi(n)$ + + 1. $1 < e < \Phi(n)$ 2. $GCD(e, \Phi(n)) = 1$ + This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. From f7fdc54ba9b2c955195af8eeaf08fc92d393f830 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:05:45 +0100 Subject: [PATCH 03/16] Update readme.md --- Cryptography/readme.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 4c21441e..0418e700 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -71,13 +71,19 @@ As mentioned above, the private key consists of the multiplicative inverse of ou So there is nothing more to do than to calculate $d=e^{-1}\,mod\,\Phi(n)$. We have to do this using the extended Euclidean algorithm, for which there are various approaches. -To decrypt a received ciphertext, we have to exponentiate it with our private key: $m'=c^d\,mod\,n$ +To decrypt a received ciphertext, we have to exponentiate it with our private key: + +$m'=c^d\,mod\,n$ ### Example In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. -We are given the prime numbers $p=23$ and $q=31$. Our n is therefore $n=p*q=23*31=713$. +We are given the prime numbers $p=23$ and $q=31$. Our n is therefore + +$n=p*q=23*31=713$. + #### Step 1: $\Phi(n)$ As shown above, we do a simple calculation: + $\Phi(n)=\Phi(p)*\Phi(q)=(p-1)*(q-1)=30*22=660$ #### Step 2: Encryption exponent e From 4b424ad7abfc55879aabc66edf2085116d2a7b1c Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:12:21 +0100 Subject: [PATCH 04/16] Update readme.md --- Cryptography/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 0418e700..aa355721 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -50,7 +50,7 @@ This proves to be particularly difficult to do, as even computers have difficult ### Step 1: Finding n To avoid this when generating the key, the n is chosen so that it is the product of two high prime numbers. This has the advantage that simple mathematical rules can be applied to determine the Phi of the product n. The property that prime numbers and the Phi function share is that they are divisors of all numbers (except 1, but this does not play a role in the Phi function either) and therefore Phi of a prime number p is equal to p-1. -If you now want to determine the Phi of the product, you can simply multiply the prime numbers p and q as follows: $\Phi(n)=\Phi(p)*\Phi(q)=(p-1)*(q-1)$. +If you now want to determine the Phi of the product, you can simply multiply the prime numbers p and q as follows: $\Phi(n)=\Phi(p)\times\Phi(q)=(p-1)\times(q-1)$. With this step, we have now determined our n and the phi of n. ### Step 2: Finding e @@ -79,12 +79,12 @@ $m'=c^d\,mod\,n$ In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. We are given the prime numbers $p=23$ and $q=31$. Our n is therefore -$n=p*q=23*31=713$. +$n=p\timesq=23\times31=713$. #### Step 1: $\Phi(n)$ As shown above, we do a simple calculation: -$\Phi(n)=\Phi(p)*\Phi(q)=(p-1)*(q-1)=30*22=660$ +$\Phi(n)=\Phi(p)\times\Phi(q)=(p-1)\times(q-1)=30\times22=660$ #### Step 2: Encryption exponent e I have chosen a small value for demonstration purposes. @@ -99,7 +99,7 @@ In the example, a table form is used in which the following formulae apply: 1. $a_{i+1}=b_i$ 2. $b_{i+1}=r_i$ 3. $x_i=y_{i+1}$ -4. $y_i=x_{i+1}-q_i*x_i$ +4. $y_i=x_{i+1}-q_i\timesx_i$ 5. $x_n=0$ ^ $y_n=1$ We remember that the decryption exponent is calculated as follows: $d=e^{-1}\,mod\,\Phi(n)$ From 7bd05b2bab67d37715dc2407fdf28bcfea336539 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:13:38 +0100 Subject: [PATCH 05/16] Update readme.md --- Cryptography/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index aa355721..a663296e 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -64,16 +64,16 @@ The following steps must be observed when choosing a suitable e: This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $cipher\,c=m^e\,mod\,n$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $cipher\quadc=m^e\quadmod\quadn$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. -So there is nothing more to do than to calculate $d=e^{-1}\,mod\,\Phi(n)$. +So there is nothing more to do than to calculate $d=e^{-1}\quadmod\quad\Phi(n)$. We have to do this using the extended Euclidean algorithm, for which there are various approaches. To decrypt a received ciphertext, we have to exponentiate it with our private key: -$m'=c^d\,mod\,n$ +$m'=c^d\quadmod\quadn$ ### Example In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. @@ -102,7 +102,7 @@ In the example, a table form is used in which the following formulae apply: 4. $y_i=x_{i+1}-q_i\timesx_i$ 5. $x_n=0$ ^ $y_n=1$ -We remember that the decryption exponent is calculated as follows: $d=e^{-1}\,mod\,\Phi(n)$ +We remember that the decryption exponent is calculated as follows: $d=e^{-1}\quadmod\quad\Phi(n)$ We determine this as follows: From 4873a5396622a17c418715e6987beeedfc56983c Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:14:09 +0100 Subject: [PATCH 06/16] Update readme.md --- Cryptography/readme.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index a663296e..a00eff02 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -57,23 +57,22 @@ With this step, we have now determined our n and the phi of n. The next step is to search for our encryption exponent e. This is used to encrypt the message we are transmitting. The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. The following steps must be observed when choosing a suitable e: - 1. $1 < e < \Phi(n)$ 2. $GCD(e, \Phi(n)) = 1$ This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $cipher\quadc=m^e\quadmod\quadn$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $cipherc=m^emodn$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. -So there is nothing more to do than to calculate $d=e^{-1}\quadmod\quad\Phi(n)$. +So there is nothing more to do than to calculate $d=e^{-1}mod\Phi(n)$. We have to do this using the extended Euclidean algorithm, for which there are various approaches. To decrypt a received ciphertext, we have to exponentiate it with our private key: -$m'=c^d\quadmod\quadn$ +$m'=c^dmodn$ ### Example In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. @@ -102,7 +101,7 @@ In the example, a table form is used in which the following formulae apply: 4. $y_i=x_{i+1}-q_i\timesx_i$ 5. $x_n=0$ ^ $y_n=1$ -We remember that the decryption exponent is calculated as follows: $d=e^{-1}\quadmod\quad\Phi(n)$ +We remember that the decryption exponent is calculated as follows: $d=e^{-1}mod\Phi(n)$ We determine this as follows: From 8f5c592878698ca4fd89f9e19fbf506cd20bdd92 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:15:23 +0100 Subject: [PATCH 07/16] Update readme.md --- Cryptography/readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index a00eff02..f35a2b8e 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -57,13 +57,14 @@ With this step, we have now determined our n and the phi of n. The next step is to search for our encryption exponent e. This is used to encrypt the message we are transmitting. The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. The following steps must be observed when choosing a suitable e: - 1. $1 < e < \Phi(n)$ - 2. $GCD(e, \Phi(n)) = 1$ + +1. $1 < e < \Phi(n)$ +2. $GCD(e, \Phi(n)) = 1$ This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $cipherc=m^emodn$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\:n$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. From cb85bcbfe964cf3a6d186e772a5fec50a791e70a Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:15:52 +0100 Subject: [PATCH 08/16] Update readme.md --- Cryptography/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index f35a2b8e..a93808da 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -64,7 +64,7 @@ The following steps must be observed when choosing a suitable e: This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\:n$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\n$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. From 221bb1cee1550fe782528019cdf15e4f9d48f2ce Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:16:13 +0100 Subject: [PATCH 09/16] Update readme.md --- Cryptography/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index a93808da..2e14c522 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -64,7 +64,7 @@ The following steps must be observed when choosing a suitable e: This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\n$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\ n$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. From de55cbab6c9f5d80ca6e88abb76ebf19195f709c Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:17:14 +0100 Subject: [PATCH 10/16] Update readme.md --- Cryptography/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 2e14c522..c214080d 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -64,11 +64,11 @@ The following steps must be observed when choosing a suitable e: This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. -Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}mod\ n$ +Now we have our public key composed of n and e and can encrypt messages m as follows: $c=m^{e}\ mod\ n$ ### Step 3: Private Key As mentioned above, the private key consists of the multiplicative inverse of our encryption exponent in the remainder class ring $\Phi(n)$. -So there is nothing more to do than to calculate $d=e^{-1}mod\Phi(n)$. +So there is nothing more to do than to calculate $d=e^{-1}\ mod\ \Phi(n)$. We have to do this using the extended Euclidean algorithm, for which there are various approaches. To decrypt a received ciphertext, we have to exponentiate it with our private key: @@ -102,7 +102,7 @@ In the example, a table form is used in which the following formulae apply: 4. $y_i=x_{i+1}-q_i\timesx_i$ 5. $x_n=0$ ^ $y_n=1$ -We remember that the decryption exponent is calculated as follows: $d=e^{-1}mod\Phi(n)$ +We remember that the decryption exponent is calculated as follows: $d=e^{-1}\ mod\ \Phi(n)$ We determine this as follows: From 74bb9900d6fe3e390d65d3bdb8319f8f33521ecc Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:18:18 +0100 Subject: [PATCH 11/16] Update readme.md --- Cryptography/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index c214080d..fe8d3e5d 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -79,12 +79,12 @@ $m'=c^dmodn$ In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. We are given the prime numbers $p=23$ and $q=31$. Our n is therefore -$n=p\timesq=23\times31=713$. +$n=p\times q=23\times 31=713$. #### Step 1: $\Phi(n)$ As shown above, we do a simple calculation: -$\Phi(n)=\Phi(p)\times\Phi(q)=(p-1)\times(q-1)=30\times22=660$ +$\Phi(n)=\Phi(p)\times \Phi(q)=(p-1)\times (q-1)=30\times 22=660$ #### Step 2: Encryption exponent e I have chosen a small value for demonstration purposes. @@ -99,7 +99,7 @@ In the example, a table form is used in which the following formulae apply: 1. $a_{i+1}=b_i$ 2. $b_{i+1}=r_i$ 3. $x_i=y_{i+1}$ -4. $y_i=x_{i+1}-q_i\timesx_i$ +4. $y_i=x_{i+1}-q_i\times x_i$ 5. $x_n=0$ ^ $y_n=1$ We remember that the decryption exponent is calculated as follows: $d=e^{-1}\ mod\ \Phi(n)$ From d0814d9ec16cafdc42d1790a5b4088378ff02640 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:19:05 +0100 Subject: [PATCH 12/16] Resolved Formatting Issues --- Cryptography/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index fe8d3e5d..a7673cf6 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -73,7 +73,7 @@ We have to do this using the extended Euclidean algorithm, for which there are v To decrypt a received ciphertext, we have to exponentiate it with our private key: -$m'=c^dmodn$ +$m'=c^d\ mod\ n$ ### Example In the following I will give a small example of the RSA calculation. This is carried out with comparatively tiny integers and is purely for demonstration purposes. From b7e6f6b7208a28745a4a2aca5247e6f8d39327ca Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:23:45 +0100 Subject: [PATCH 13/16] Added explaination --- Cryptography/readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index a7673cf6..7033a9ff 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -58,8 +58,10 @@ The next step is to search for our encryption exponent e. This is used to encryp The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. The following steps must be observed when choosing a suitable e: -1. $1 < e < \Phi(n)$ -2. $GCD(e, \Phi(n)) = 1$ +1. It must be co-prime to \(\Phi(n)\): The value of \(e\) must have no common factors with \(\Phi(n)\) except 1, which is expressed mathematically as \(\text{GCD}(e, \Phi(n)) = 1\). This requirement ensures that \(e\) has a unique multiplicative inverse modulo \(\Phi(n)\). In simpler terms, there must be a number \(d\) (which will be the decryption exponent) such that \(e \times d\) is congruent to 1 modulo \(\Phi(n)\). + +2. It must be within the range \(1 < e < \Phi(n)\): This range ensures that \(e\) is a valid exponent for the modulo operation and helps maintain the encryption's mathematical properties. + This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. A frequently used e is 65537, which is $2^{16}+1$ and a prime number. From e3ab8cc4ddd27c1f948d23795d9e692e65582fa4 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:25:37 +0100 Subject: [PATCH 14/16] Update readme.md --- Cryptography/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 7033a9ff..3d962d4d 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -58,9 +58,9 @@ The next step is to search for our encryption exponent e. This is used to encryp The n from step 1 and the e combined are therefore the public key with which messages can be encrypted. The following steps must be observed when choosing a suitable e: -1. It must be co-prime to \(\Phi(n)\): The value of \(e\) must have no common factors with \(\Phi(n)\) except 1, which is expressed mathematically as \(\text{GCD}(e, \Phi(n)) = 1\). This requirement ensures that \(e\) has a unique multiplicative inverse modulo \(\Phi(n)\). In simpler terms, there must be a number \(d\) (which will be the decryption exponent) such that \(e \times d\) is congruent to 1 modulo \(\Phi(n)\). +1. **It must be co-prime to $\Phi(n)$**: The value of $e$ must have no common factors with $\Phi(n)$ except 1, which is expressed mathematically as $GCD(e, \Phi(n)) = 1$. This requirement ensures that $e$ has a unique multiplicative inverse modulo $\Phi(n)$. In simpler terms, there must be a number $d$ (which will be the decryption exponent) such that $e \times d$ is congruent to 1 modulo $\Phi(n)$. -2. It must be within the range \(1 < e < \Phi(n)\): This range ensures that \(e\) is a valid exponent for the modulo operation and helps maintain the encryption's mathematical properties. +2. It must be within the range $1 < e < \Phi(n)$: This range ensures that $e$ is a valid exponent for the modulo operation and helps maintain the encryption's mathematical properties. This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. From b7c09f556a6f627d5a747e7cd8fccff36ec54ef0 Mon Sep 17 00:00:00 2001 From: Pand3ru <57118272+Pand3ru@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:25:58 +0100 Subject: [PATCH 15/16] Update readme.md --- Cryptography/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index 3d962d4d..d470dad4 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -60,7 +60,7 @@ The following steps must be observed when choosing a suitable e: 1. **It must be co-prime to $\Phi(n)$**: The value of $e$ must have no common factors with $\Phi(n)$ except 1, which is expressed mathematically as $GCD(e, \Phi(n)) = 1$. This requirement ensures that $e$ has a unique multiplicative inverse modulo $\Phi(n)$. In simpler terms, there must be a number $d$ (which will be the decryption exponent) such that $e \times d$ is congruent to 1 modulo $\Phi(n)$. -2. It must be within the range $1 < e < \Phi(n)$: This range ensures that $e$ is a valid exponent for the modulo operation and helps maintain the encryption's mathematical properties. +2. **It must be within the range $1 < e < \Phi(n)$**: This range ensures that $e$ is a valid exponent for the modulo operation and helps maintain the encryption's mathematical properties. This means that the e must be located in the residue class ring and is not a divisor of $\Phi(n)$. From 49a327eb5e3fe1d3245aa8edbf5fc11bda4552fc Mon Sep 17 00:00:00 2001 From: sifat Date: Sat, 3 Feb 2024 00:36:02 +0600 Subject: [PATCH 16/16] Fix link --- Cryptography/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cryptography/readme.md b/Cryptography/readme.md index d470dad4..7fd97884 100644 --- a/Cryptography/readme.md +++ b/Cryptography/readme.md @@ -34,7 +34,7 @@ Hash functions are used to map data of arbitrary size to data of fixed size. The 3. [Playfair Cipher](notadded) 4. [DES](notadded) 5. [AES](notadded) -6. [RSA](##RSA (Rivest-Shamir-Adleman)) +6. [RSA](#rsa-rivest-shamir-adleman) 7. [Diffie-Hellman Key Exchange](notadded) 8. [ElGamal](notadded) 9. [Digital Signature Algorithm](notadded) @@ -42,7 +42,7 @@ Hash functions are used to map data of arbitrary size to data of fixed size. The ## RSA (Rivest-Shamir-Adleman) **IMPORTANT NOTE**: - 1. Do not implement techniques like these yourself in an enviroment, that can hurt you in any kind of way. + 1. Do not implement techniques like these yourself in an environment, that can hurt you in any kind of way. 2. The shown RSA method is already broken! This guide aims to give you a basic understanding of the algorithm. Broken down, the RSA method is nothing more than the multiplicative inverse within a residue class ring. This means that the task is to find an inverse modulo the Eulerian phi function of a high integer n that is difficult to compute.