implemented diffie hellman