Skip to content

Educational Merkle-Diffie-Hellman key exchange private key finder

License

Notifications You must be signed in to change notification settings

thrasosc/MDH-Private-Key-Finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

MDH Private Key Finder

This is a basic educational python program based on the Merkle-Diffie-Hellman key exchange. I initially wrote this in C++, but then realised C++ does not handle large numbers so well, so I translated it into Python. This is actually my first Python program.

How it works

Computes the public key (X) by raising the generator to the power of the private key (x) and then performing modulo P (Gx mod P). The program iterates over private keys starting from 0, until a matching public key (public_key = X) is found.

Demonstration

1. Input G (generator)

A_1

2. Input P (modulo)

A_2

3. Input X (public key)

A_3

4. All trial results are printed to the console

A_4

5. We see the corresponding private key of X

A_5

About

Educational Merkle-Diffie-Hellman key exchange private key finder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages