//private const string k = "c9m2VBt3hNqwM0nsUI1dfg4GHJKvb7LeASrjko8paZXyC5OPDF6QWluiERzxT Y";
        public MilkShake()
        {
            //CODEGEN: This call is required by the ASP.NET Web Services Designer
            InitializeComponent();

            string lk = "";

            for (int n = 1; n <= k.Length; n++)
            {
                if (n % 2 == 0) lk += k.Substring(n - 1, 1);
            }

            mile = new MilkShakeEngine.Engine(lk);
        }
Example #2
0
        private bool encrypt()
        {
            bool b = false;

            try
            {
                en = new MilkShakeEngine.Engine(textBox4.Text);
                textBox2.Text = en.encrypt(textBox1.Text);
                textBox3.Text = en.decrypt(textBox2.Text);
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
                b = false;
                return b;
            }

            label1.Text = "Input length: " + textBox1.Text.Length;
            label2.Text = "Encrypted length: " + textBox2.Text.Length;

            if (textBox1.Text == textBox3.Text)
            {
                label3.Text = "Verified";
                b = true;
            }
            else
            {
                label3.Text = "Problem detected";
            }

            Application.DoEvents();
            return b;
        }