Пример #1
1
        public string Decrypt(string cipherText)
        {
            Polybius poly = new Polybius(alphabet);
            poly.RowHeaders = new char[] { 'A', 'D', 'F', 'G', 'V', 'X' };
            poly.ColumnHeaders = new char[] { 'A', 'D', 'F', 'G', 'V', 'X' };
            poly.Square = Square;

            Columnar column = new Columnar(alphabet);
            column.Key = Key;

            return poly.Decrypt(column.Decrypt(cipherText));
        }
Пример #2
0
        public string Encrypt(string clearText)
        {
            Polybius poly = new Polybius(alphabet);
            poly.RowHeaders = new char[] { 'A', 'D', 'F', 'G', 'X' };
            poly.ColumnHeaders = new char[] { 'A', 'D', 'F', 'G', 'X' };
            poly.Square = Square;

            Columnar column = new Columnar(alphabet);
            column.Key = Key;

            return column.Encrypt(poly.Encrypt(clearText));
        }