Cryptography, Algorithms, Mathematics, Encryption, Hacking.
generating the key from these values will be difficult, as long as the value for P is large enough, the random values generated by the client and the server is regenerated for every client-server session; this adds an extra layer of security. Hopefully, you now understand the Diffie-Hellman key