private void button5_Click(object sender, EventArgs e) { /* * this button send Client ID to Authentication Server and request Key TGS and ticket * Key encrypted with Password * if the ID is in the A.S then It gets ticket and encrypted key from them. */ if (idBox.Text == "") { MessageBox.Show("Invalid Username"); } else { ncolor = Color.Black; f.printProcess("Message encryption using Password in Authentication Server (Scenario 1,2)", ncolor); /* 1. Create Key TGS * 2. Create Ticket which has client id, create time and Key tgs. * 4. Create message with Ticket and Key TGS * 3. Encrypt the Message with client's password * 4. send the encrypted Message to Client. * */ string ticket = "ID:" + idBox.Text + ":time:" + (DateTime.Now.ToString("yyyyMMddHHmm")); //Create ticket textBox1.Text = aServer.getTGSkey(); ticketBox.Text = ticket; textBox3.Text = ticket + ":key:" + aServer.getTGSkey(); encKey = secCol.encryption(secCol.getBit(ticket + ":key:" + aServer.getTGSkey()), tabCol, aServer.getPassword(idBox.Text), f); // Encrypt the ticket using Password. encKeyBox.Text = encKey; button3.Enabled = true; mainPage.setFlag(1); mainPage.setFlag(2); f.setFlag(1); } }