Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Stopwatch d1   = new Stopwatch();
            LFSR      obj1 = new LFSR();

            obj1.TapPosIndx = (int)nudMaskSize.Value;

            if (textBox1.Text.Length > 10)
            {
                MessageBox.Show("please enter an initial seed less than 10 characters");
            }
            else
            {
                string seed = ImageOperations.AlphanumericSeed(textBox1.Text);
                obj1.Seed = Convert.ToInt64(seed, 2);        //5adet el string as bits where 2 means binary
                int SeedLength = (textBox1.Text.Length * 6);

                d1.Start();
                ImageMatrix = ImageOperations.Encryption(ImageMatrix, ref obj1.Seed, obj1.TapPosIndx, SeedLength);
                d1.Stop();

                ImageOperations.DisplayImage(ImageMatrix, pictureBox2);
                MessageBox.Show("RunTime = " + Convert.ToString(d1.Elapsed.TotalMinutes));
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Stopwatch d1 = new Stopwatch();


            LFSR obj1 = new LFSR();

            obj1.TapPosIndx = (int)nudMaskSize.Value;
            obj1.Seed       = Convert.ToInt64(textBox1.Text, 2);  //5adet el string as bits where 2 means binary
            int SeedLength = textBox1.Text.Length - 1;

            d1.Start();
            ImageMatrix = ImageOperations.Encryption(ImageMatrix, ref obj1.Seed, obj1.TapPosIndx, SeedLength);
            d1.Stop();

            ImageOperations.DisplayImage(ImageMatrix, pictureBox2);
            MessageBox.Show("RunTime = " + Convert.ToString(d1.Elapsed.TotalMinutes));
        } //Encryption & decryption