How to encrypt post parameters in Inno Setup

463 views Asked by At

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

1

There are 1 answers

1
Martin Prikryl On

Just use an HTTPS URL, like:

https://www.example.com/

The encryption happens automatically.