I have narrowed the problem down a little. A String contains (key,"-",vote). The "key" is a base64 string (a random key), and vote is a string encrypted with that random key, both are base64 strings. The string containing all of this information (with the "-" to seperate them) is encoded to a byte array (using Encoding.ASCII.GetBYtes) then added to a network stream and sent to the server. When it arrives at the server i convert it back to a string (Using Encoding.ASCII.GetString), that string is then stripped with a regular expression giving me a string array. Now if i send the string so the encrypted vote is at the end the, "Convert.FromBase64String" statement throws an error saying it contains illegal character (whihc is not true, becasue i can see what is in the string), but if i send the string with the encrypted vote first the same statement works.... read more