using(varbob=new DiffieHellman())using(varalice=new DiffieHellman()){
Console.WriteLine("Bob Private Key: {0}\n", Convert.ToBase64String(bob.PrivateKey));
Console.WriteLine("Alice Private Key: {0}\n", Convert.ToBase64String(alice.PrivateKey));
Console.WriteLine("Bob IV: {0}\n", Convert.ToBase64String(bob.AesIV));
Console.WriteLine("Alice IV: {0}\n", Convert.ToBase64String(alice.AesIV));byte[]data= Encoding.UTF8.GetBytes("{ KeMaL; }");// Bob uses Alice's public key to encrypt his data.byte[]secretData=await bob.EncryptAsync(alice.PublicKey, data);// Alice uses Bob's public key and IV to decrypt the secret data.byte[]decryptedData=await alice.DecryptAsync(bob.PublicKey, secretData, bob.AesIV);}