From 0b157a639e7934bc3a34bc34e6f040b840d4c3b3 Mon Sep 17 00:00:00 2001 From: Omar Santos Date: Tue, 15 Aug 2023 09:51:13 -0400 Subject: [PATCH] Update 02_Diffie_Hellman_Key_Exchange.md --- .../02_Diffie_Hellman_Key_Exchange.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/crypto/challenges/02_Diffie_Hellman_Key_Exchange.md b/crypto/challenges/02_Diffie_Hellman_Key_Exchange.md index e5bcb33..ce647d7 100644 --- a/crypto/challenges/02_Diffie_Hellman_Key_Exchange.md +++ b/crypto/challenges/02_Diffie_Hellman_Key_Exchange.md @@ -12,24 +12,11 @@ n = 3233, e = 17, Encrypted message: [2201, 2332, 1452] ### Answer: -Here are the detailed solutions for each step: -**Step 1:** Factorize \( n = 3233 \) into two prime numbers: - \( p = 61 \), \( q = 53 \) +image -**Step 2:** Compute the Euler's Totient function \( \phi(n) \): - \( \phi(n) = (p-1)(q-1) = 3120 \) -Compute the private key \( d \) such that: - \( de \equiv 1 \mod \phi(n) \) - -Using Extended Euclidean Algorithm, we can find: - \( d = 2753 \) - -**Step 3:** Decrypt the message using the private key: - Decrypted message: "HEY" - -Here's a code snippet in Python to perform the entire decryption: +Code snippet in Python to perform the entire decryption: ```python def egcd(a, b): @@ -61,4 +48,4 @@ decrypted_text = decrypt_rsa(ciphertext, n, e) print(decrypted_text) # Output: "HEY" ``` -This challenge provides an understanding of the RSA algorithm, which is foundational in modern cryptography. It covers important concepts like prime factorization, modular arithmetic, and key derivation. +This challenge provided you with an understanding of the RSA algorithm. It covered important concepts like prime factorization, modular arithmetic, and key derivation.