I also think the problem happens due to data conversion. Here is just my humble opinion: you can try again with the base64 encoding with help from the System.Convert class. When converting data from bytes to string, you can make use of the System.Convert.ToBase64String method, then you can filter out data. When converting data back to bytes, you can use the System.Convert.FromBase64String method. Hope that helps.