Hello, there is a problem with the Vigenere cipher implementation. It is not possible to access the elements of the table and write to the string literal.
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btn_shifr_Click(object sender, EventArgs e) { Schifrovanie(); } private void Schifrovanie() { string key = txbx_key.ToString(); string x = ""; string alf = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"; string tmp; string rez = ""; int p = 0; for(int k = 0; k < key.Length; k++) { p = alf.IndexOf(key.Substring(k, 1)); for (int j = 0; j < alf.Length; j++) { //Составление таблицы Виженера x = alf.Substring((j + p) % alf.Length, 1); //шифрование открытого текста //tmp = alf.Substring(txbx_openText.Text.Substring(j, 1)% txbx_key.Text.Length); rez += tmp; } } } }