Diffie-Hellman algorithm theory question

Hi guys I am doing some theory in the Diffie-Hellman algorithm,I don't have to implement it in code just yet,just doing the theory, anyway I get an answer of 1 for the shared key I will most my steps please tell me if I am right

A = (3^4) mod 11
A = 81 mod 11 = 4
Alice sends bob the number 4

B = (3^5) mod 11
B = 243 mod 11 = 1
Bob sends Alice the number 4

shared key = (1^4) mod 11
shared key = 1 mod 11 = 1

shared key = (4^5) mod 11
shared key = 1024 mod 11 = 1

so 1 is the shared key? doesn't seem to secure considering we sent 4 and 1(the shared key) in public?

is 1 the correct answer or have I done something wrong in my calculations?

question is below

Two users Alice and Bob want to agree on a secret key over a public

network. They have agreed to use the Diffie Hellman algorithm to achieve

this. Given the values below what will be the value of the shared secret

key generated by Alice and Bob?

A random prime : 11

A generator : 3

Alice’s random secret : 4

Bob’s random secret : 5

Key is 1. You're correct.

It doesn't seem secure because you're using a small n and g. Typically, these numbers are large. The security lies in the difficulty of factoring large numbers.
Last edited on
Topic archived. No new replies allowed.