Example #1
0
        private void login_button_Click(object sender, EventArgs e)
        {
            //TDES ttt = new TDES();
            //ttt.InitTDES("12312134123testdfafasafasfasff");
            //string str = ttt.Encrypt(email_textBox.Text);
            //ttt.InitTDES("0989870987dfskd;lfkslk;;lk/.df");
            //string str1 = ttt.Decrypt(str);
            //MessageBox.Show(str);
            //MessageBox.Show(str1);

            string hash_output = HashingSHA.Hash(pswd_textBox.Text);
            // divide into two keys
            string key1 = hash_output.Substring(0, hash_output.Length / 2);
            //MessageBox.Show(key1);
            string key2 = hash_output.Substring(hash_output.Length / 2, hash_output.Length / 2);

            //MessageBox.Show(key2);
            Controller.GetInstance().initEncryptors(key1, key2);
            if (Controller.GetInstance().SignIn(email_textBox.Text))
            {
                Main_Window mainWind = new Main_Window();
                mainWind.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Please Check Your Email and Password");
            }
        }
Example #2
0
        private void encrypt_button_Click(object sender, EventArgs e)
        {
            string hash_output = HashingSHA.Hash(pswd_textBox.Text);
            // divide into two keys
            string key1 = hash_output.Substring(0, hash_output.Length / 2);
            //MessageBox.Show(key1);
            string key2 = hash_output.Substring(hash_output.Length / 2, hash_output.Length / 2);

            //MessageBox.Show(key2);
            Controller.GetInstance().initEncryptors(key1, key2);
            if (Controller.GetInstance().SignUp(email_textBox.Text))
            {
                Main_Window mainWind = new Main_Window();
                mainWind.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Please Check Your Email and Password");
            }
        }