Exemplo n.º 1
0
        private void BuildMachine()
        {
            //tbKey.Text = Convert.ToString(udDiskCount.Value);

            byte[] Seeds = new byte[(byte)udDiskCount.Value];
            for (byte i = 0; i < udDiskCount.Value; i++)
            {
                Seeds[i] = Convert.ToByte(gvDisks[1, i].Value);
            }
            //tbKey.Text += Convert.ToString((byte)udStartPos.Value, 16);
            Enigma = new EnigmaMachine(Seeds);

            //tbSrcStr_TextChanged(null, null);
        }
Exemplo n.º 2
0
        private void BuildCustomize()
        {
            byte[] Seeds      = new byte[(byte)udDiskCount.Value];
            bool[] Dirs       = new bool[(int)udDiskCount.Value];
            byte[] StartPoses = new byte[(byte)udDiskCount.Value];
            for (byte i = 0; i < udDiskCount.Value; i++)
            {
                Seeds[i]      = Convert.ToByte(gvDisks[1, i].Value);
                Dirs[i]       = Convert.ToBoolean(gvDisks[2, i].Value);
                StartPoses[i] = Convert.ToByte(gvDisks[3, i].Value);
            }

            Enigma = new EnigmaMachine(Seeds);
            Enigma.Customize(Dirs, StartPoses);
        }