public Alice()
 {
     P_G        = DiffieHellman.GetTwoCryptoPrimes();
     PrivateKey = DiffieHellman.PrivateKey(P_G.Item1);
     PublicKey  = DiffieHellman.PublicKey(P_G.Item1, P_G.Item2, PrivateKey);
     //check if bob has supplied public key yet
 }
        public CNG B(CNG c)
        {
            c.Alice.P_G      = c.Bob.P_G = DiffieHellman.GetTwoCryptoPrimes();
            c.Bob.PrivateKey = DiffieHellman.PrivateKey(c.Bob.P_G.Item1);
            c.Bob.PublicKey  = DiffieHellman.PublicKey(c.Bob.P_G.Item1, c.Bob.P_G.Item2, c.Bob.PrivateKey);
            if (c.Alice.PublicKey != null)
            {
                c.Bob.Key = c.Alice.Key = DiffieHellman.Secret(c.Bob.P_G.Item1, c.Alice.PublicKey, c.Bob.PrivateKey);
            }


            return(c);
        }
        public CNG A(CNG c)
        {
            //alice creates a public and private key
            c.Alice.P_G        = c.Bob.P_G = DiffieHellman.GetTwoCryptoPrimes();
            c.Alice.PrivateKey = DiffieHellman.PrivateKey(c.Alice.P_G.Item1);
            c.Alice.PublicKey  = DiffieHellman.PublicKey(c.Alice.P_G.Item1, c.Alice.P_G.Item2, c.Alice.PrivateKey);
            //check if bob has supplied public key yet
            if (c.Bob.PublicKey != null)
            {
                c.Bob.Key = c.Alice.Key = DiffieHellman.Secret(c.Alice.P_G.Item1, c.Bob.PublicKey, c.Alice.PrivateKey);
            }

            return(c);
        }