I'm trying to wrap my head around Hellman, Diffie, and Merkle's key exchange design, but after reading the Wiki article about it, I can't figure out how the commonly known factor ('p', I think) comes to be?
In the initial laymen description, they first describe it with: "Note that the yellow paint is already agreed by Alice and Bob". Yet the original description of the exchange is: "The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key."
Where does the shared base 'paint' (which I understand to be a commonly known prime number) come from? Is it built into the algorithm itself? Presuming anyone could know it, why isn't that a problem in preventing man-in-the-middle attacks from hijacking both connections with their own key and providing a 'translation' service between two encryption keys based on the attacker's private key?