Esempio n. 1
0
        private void Decode()
        {
            List <string> dico = DicoInit.ClassicMin();

            foreach (string s in _codes)
            {
                string decode = BinToString(s);

                string res = "";
                for (int i = 0; i < decode.Length; i++)
                {
                    char c         = decode[i];
                    bool isCorrect = false;
                    foreach (string d in dico)
                    {
                        if (c.ToString() == d || c.ToString() == d.ToUpper())
                        {
                            isCorrect = true;
                            break;
                        }
                    }

                    if (isCorrect || _keepInvalidChar)
                    {
                        res += c;
                    }
                }

                _mots.Add(res);
            }
        }
Esempio n. 2
0
        private void vigPasswordTextBox_TextChanged(object sender, EventArgs e)
        {
            if (vigPasswordTextBox.Text == "")
            {
                _vigenereKey = null;
            }
            else
            {
                List <string> dico = DicoInit.ClassicMin();
                string        text = "";
                foreach (char c in vigPasswordTextBox.Text)
                {
                    if (!dico.Contains(c.ToString()))
                    {
                        break;
                    }
                    text += c;
                }

                _vigenereKey            = text;
                vigPasswordTextBox.Text = text;
            }

            Console.Out.WriteLine(_vigenereKey);
        }
Esempio n. 3
0
        public Aero(Metadata met, bool useInternational)
        {
            _metadata        = met;
            _finished        = false;
            _keepInvalidChar = met.KeepInvalidChar;

            _dicoAero    = useInternational ? DicoInit.AeroIntMin() : DicoInit.AeroFrMin();
            _dicoAeroMaj = useInternational ? DicoInit.AeroIntMaj() : DicoInit.AeroFrMaj();
        }
Esempio n. 4
0
        public static string GetTable()
        {
            var table = InitTable();

            List <string> d   = DicoInit.ClassicMin();
            string        res = "";

            foreach (string s in d)
            {
                res += $"{s} : ";
                List <string> data = table[s];
                foreach (string sd in data)
                {
                    res += $"{sd} ";
                }
                res += "\n";
            }

            return(res);
        }
Esempio n. 5
0
        private static Dictionary <string, List <string> > InitTable()
        {
            Dictionary <string, List <string> > tmp = new Dictionary <string, List <string> >();
            List <string> firstLine = DicoInit.ClassicMin();

            tmp.Add("a", firstLine);

            for (int i = 1; i < 26; i++)
            {
                List <string> nextLine = new List <string>();
                for (int j = 1; j < firstLine.Count; j++)
                {
                    nextLine.Add(firstLine[j]);
                }
                nextLine.Add(firstLine[0]);

                string lettre = nextLine[0];
                tmp.Add(lettre, nextLine);

                firstLine = nextLine;
            }

            return(tmp);
        }