My guess is that ToBurtal
is getting modified inside the Decrypt
function. Try it with a local copy of the array and see if that fixes your issue:
byte[] ToBurtalTemp = new byte[ToBurtal.Length];
Array.Copy(ToBurtal, ToBurtalTemp, ToBurtal.Length);
foreach (string temp in (ASCIIEncoding.ASCII.GetString(CR.Decrypt(ToBurtalTemp))).Split('\n'))
// etc.