-1

I am sending a http get request from server side to another site. How can I encrypt all data before sending the request? How can I decrypt the parameters in the second site to read them back? What encryption do we generally use for this?

var response = HttpContext.Current.Response;
response.Redirect(string.Format("http://localhost:58372/Testsite?type={0}&requestxml={1}", type, requestXML));
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Jyina
  • 2,530
  • 9
  • 42
  • 80

1 Answers1

0

Convert the parameters into base64 encode / decode. Make sure u convert your all parameters to string.

Encode

 var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(stringtoencode);
  return System.Convert.ToBase64String(plainTextBytes);

Decode

  var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
  return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
Usman Khalid
  • 140
  • 1
  • 8