Taken from http://en.wikipedia.org/wiki/Public-key_cryptography
In the Diffie–Hellman key exchange scheme, each party generates a public/private key pair and distributes the public key. After obtaining an authentic copy of each other's public keys, Alice and Bob can compute a shared secret offline. The shared secret can be used, for instance, as the key for a symmetric cipher.
My question is, given the arbitrary public key (Bob's) and arbitrary private key (Alice's), how can we implement this function (derive the shared secret key offline) in C#?
private static SecretKey generateSharedSecret(PrivateKey private_key, PublicKey public_key)
{
//combine the keys
return secretKey;
}