Hi, My application makes a POST to a website that responds with encrypted data. When I use httpwebrequest/httpwebresponse and Encoding.UTF8.GetBytes() to convert the string back to a byte array and pass it to my decrypt function along with the key the decryption fails. Now, I know my decryption function is working properly because if i use tcpclient and make the POST the hard way and parse the data manually, pass it to my decryption method it works so my question to you is how can I get the response from httpwebresponse back as a raw byte array or how can i convert the string back? Here is how I am handling the response:
VB.NET:
Response = (HttpWebResponse)Request.GetResponse();
Stream receiveStream = Response.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream,
System.Text.Encoding.UTF8);
string sResponse = readStream.ReadToEnd();