I was sifting through the Node Crytpo library and I came across their Diffie Hellman utility class. Their class implements a generateKeys
function that, in their words,
Generates private and public Diffie-Hellman key values, and returns the public key in the specified encoding
My understanding of Diffie Hellman is that both parties only ever need to generate a single random number, not a public/private key. I suppose that you could call this random number a public key and that's what this function returns, but where does a private key come into this process?
I know that in Station to Station protocol a public/private key pair is used for signing. Is that what is happening here? Could this class be used for Station to Station protocol as is?