If you have any queries please leave a message here
Your Message

The Diffie-Hellman protocol is a method for two computer users to generate a shared private key with which they can then exchange information across an insecure channel.
Let the users be named User1 and User2. First, they agree on two prime numbers g and p. The numbers g and p need not be kept secret from other users.
Now User1 chooses a large random number a as his private key and User2 similarly chooses a large number b.

User1 then computes A = (ga mod p), which he sends to User2, and User2 computes B = (gb mod p), which he sends to User1.

Now User1 computes Key = (Ba mod p) = ((gb mod p)a mod p)

and User2 computes Key = (Ab mod p) = ((ga mod p)b mod p)

Example -

user1 and User2 agree on p = 13 and g = 5.

User1 chooses a = 4 and sends A = (ga mod p) = (54 mod 13) = 1.

User2 chooses b = 3 and sends B = (gb mod p) = (53 mod 13) = 8.

User1 computes (Ba mod p) = 84 mod 13 = 1

User2 computes (Ab mod p) = 13 mod 13 = 1

Then 1 is the shared secret.


QuestionSolves.com is an educational website that helps worldwide students in solving computer education related queries.

Also, different software like Visual Studio, SQL Server, Oracle etc. are available to download in different versions.

Moreover, QuestionSolves.com provides solutions to your questions and assignments also.


Windows Command

UNIX Command

IGNOU Assignment Solution

IGNOU Question Paper Solution

Solutions of Different Questions


Website Devlopment


Home Learning

Provide BCA, MCA Projects

Provide Assignment & Question Paper Solution


Follow Us