As far as I understood, when using Diffie Hellman, the pre master secret is generated as follows:
- Alice and Bob agree on a generator
g
and a primep
- Alice chooses a primary key
a
, calculatesA = g^a mod p
and sends the result to Bob - Bob chooses a primary key
b
, calculatesk = A^b mod p
and receives the pre master secret as a resultk
However, if I do that with, say, a 4096 bit p
, k
also has 4096 bits which seems too large, especially because if I want to hand it over to wireshark in a SSLKEYLOGFILE, wireshark truncates the line after 512 bytes, not reading the whole secret. Is my train of thought correct or is the pre master secret something else?