1

I have to post some user entered dynamic data to my server while installing. I can post the data successfully. But to post the data securely i have to encrypt the data while posting. I don't know how to do this..

Here is my code,

procedure CurStepChanged(CurStep: TSetupStep);
var
  WinHttpReq: Variant;
begin
  if CurStep = ssInstall then
  begin
    if AutoCheckRadioButton.Checked = True then
    begin
      WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
      WinHttpReq.Open('POST', '<web_server>', false);
      WinHttpReq.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      WinHttpReq.Send('<need to encrypt data>');
      { WinHttpReq.ResponseText will hold the server response }
    end;
  end;
end;

Thanks in advance for your help

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Arumuga Raja
  • 184
  • 13
  • If your web server supports HTTPS and the URL is using https protocol, the OLE object should handle it for you automatically. This ensures the data is encrypted en-route from the client to your server. – KC Wong Jan 03 '17 at 07:15

1 Answers1

1

Just use an HTTPS URL, like:

https://www.example.com/

The encryption happens automatically.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992