private void button1_Click(object sender, EventArgs e)
        {
            /*Get the request from client and the get the ticket and timestamp, and get the Key TGS from Authentication Server.
             * 1. Get Request
             * 2. Get Key TGS from Authentication Server
             * 3. Split to timestamp section and ticket section
             * */
            f.printProcess("\n\nGet Encrypted message from Client", ncolor);

            textBox1.Text   = aServer.getTGSkey();
            textBox2.Text   = p.getEncMessage();
            button3.Enabled = true;
            button1.Enabled = false;
        }
Example #2
0
        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);
            }
        }