public void gen_key_chung_from_key_public_receive(string[] mess) { dh.Tinh_key_chung(Convert.ToInt32(mess[1])); key = mySHA256.ComputeHash(Encoding.ASCII.GetBytes(Convert.ToString(dh.Key_Chung))); this.SetText(Convert.ToString(dh.Key_Chung), "Client"); textBoxkey.Text = Convert.ToBase64String(key); sesion = true; }
public void gen_keychung_va_send_key_public(string [] mess) { p = Convert.ToInt32(mess[1]); g = Convert.ToInt32(mess[2]); dh = new diffie_hellman(p, g); dh.Tinh_key_chung(Convert.ToInt32(mess[3])); key = mySHA256.ComputeHash(Encoding.ASCII.GetBytes(Convert.ToString(dh.Key_Chung))); senddata(Convert.ToString(2 + ";" + dh.Publickey)); this.SetText(Convert.ToString(dh.Key_Chung), "Client"); textBoxkey.Text = Convert.ToBase64String(key); sesion = true; }