static void Main(string[] args) { Trivium myTr = new Trivium(); Trivium myTr2 = new Trivium(); char a='1'; while((a)!=26) { a = Console.ReadKey().KeyChar; if (a != 26) { buff += a; res += (char)(myTr.GenerateByte() ^ a); dech += (char)(myTr2.GenerateByte() ^ res[res.Length - 1]); } } Console.Clear(); Console.WriteLine("--------------------------------------Entered text:"); Console.WriteLine(buff); Console.WriteLine("--------------------------------------Ciphered text:"); Console.WriteLine(res); Console.WriteLine("--------------------------------------Deciphered text:"); Console.WriteLine(dech); Console.WriteLine("--------------------------------------Ciphered and entered texts length"); Console.WriteLine(buff.Length); Console.WriteLine(res.Length); }