private void button4_Click(object sender, EventArgs e) { /* Create Key CS and encrypt the Key using Key TGS before send it to Client * 1. generate Key CS * 2. store in TGS server * 3. encrypt the Key CS, using Key TGS **/ f.printProcess("\n\nEncrpyt Key CS using Key TGS to send to Client (Scenario 10)", ncolor); f.printProcess("Encrpyt Key CS using Key TGS-S to send to Service Server (Scenario 11)", ncolor); string encToclient = secCol.encryption(secCol.getBit(tgServer.getCSkey()), tabCol, tgServer.geTGSkey(), f); string encToSServer = secCol.encryption(secCol.getBit(tgServer.getCSkey()), tabCol, tgServer.getTGSSkey(), f); textBox4.Text = tgServer.getCSkey(); textBox5.Text = encToclient; textBox10.Text = tgServer.getTGSSkey(); textBox11.Text = encToSServer; button5.Enabled = true; button4.Enabled = false; mainPage.setFlag(10); mainPage.setFlag(11); }
private void button7_Click(object sender, EventArgs e) { /* encrypt Service Request message and send it to Service Server. * show the message on display. * */ f.printProcess("\n\nCreate request message and ecnrypt the message using Key CS (Scenario 14, 15)", ncolor); encMessage = secCol.encryption(secCol.getBit(p.getServiceName()), tabCol, p.getCSKey(), f); textBox11.Text = p.getServiceName(); textBox12.Text = encMessage; button2.Enabled = true; button7.Enabled = false; mainPage.setFlag(14); mainPage.setFlag(15); }
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); } }