Diffie Hellman Key Exchange - Online Code


Diffie-Hellman key exchange (D-H) is a cryptographic protocol that allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communications channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher.

Source Code

#include "stdio.h"

#include "conio.h"

#include "math.h"

//For calculating (A^B)%C

unsigned mode_ex(unsigned base, unsigned power, unsigned modulus)


	unsigned long result=1;

... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.


No comment yet. Be the first to post a comment.