コード例 #1
0
ファイル: Language.cs プロジェクト: Lexeq/Vigenere
 public Language(string name, IList <char> alphabet, IVigenereCipher vigenereCipher, Hacks.VigenereBreaker vBreaker, Hacks.CaesarBreaker cBreaker)
 {
     Name            = name;
     Alphabet        = new List <char>(alphabet).AsReadOnly();
     VigenereCipher  = vigenereCipher;
     CaesarBreaker   = cBreaker;
     VigenereBreaker = vBreaker;
 }
コード例 #2
0
ファイル: Languages.cs プロジェクト: Lexeq/Vigenere
        static LanguagesList()
        {
            //english
            var engCaesar          = new VigenereTools.LatinCaesarCipher();
            var engVigenere        = new VigenereTools.VigenereCipher(Alphabets.English);
            var engCaesarBreaker   = new CaesarBreaker(CharFrequecies.English);
            var engVigenereBreaker = new VigenereTools.Hacks.VigenereBreaker(engCaesar, engCaesarBreaker, 0.0644);
            var eng = new Language("English", Alphabets.English, engVigenere, engVigenereBreaker, engCaesarBreaker);

            //russian
            var rusCaesar          = new VigenereTools.CaesarCipher(Alphabets.Russian);
            var rusVigenere        = new VigenereTools.VigenereCipher(Alphabets.Russian);
            var rusCaesarBreaker   = new CaesarBreaker(CharFrequecies.Russian);
            var rusVigenereBreaker = new VigenereTools.Hacks.VigenereBreaker(rusCaesar, rusCaesarBreaker, 0.0553);
            var rus = new Language("Russian", Alphabets.Russian, rusVigenere, rusVigenereBreaker, rusCaesarBreaker);

            Languages = new Language[2]
            {
                eng, rus
            };
        }