Created
February 25, 2023 07:28
-
-
Save marcos-inja/67b3b4fd48a3e109990f265c27434f3b to your computer and use it in GitHub Desktop.
Basic implementation of Diffie-Hellman key exchange algorithm using python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 1 | |
b = 3 | |
n = 97 | |
g = 5 | |
x = (g**a) % n | |
y = (g**b) % n | |
k1 = (y**a) % n | |
k2 = (x**b) % n | |
print(k1) | |
print(k2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment