Hi,
I have a program which runs OpenSSL with a few different parameters. Here is the code:
procedure TForm1.Button1Click(Sender: TObject);
var
hProcess : TProcess;
begin
hProcess := TProcess.Create(nil);
hProcess.Executable := 'C:\OPENSSL\bin\openssl';
hprocess.Parameters.Add('aes-256-cbc');
hprocess.Parameters.Add('-a');
hprocess.Parameters.Add('-in C:\Users\SamSmith\secrets.txt');
hprocess.Parameters.Add('-out C:\Users\SamSmith\secrets.txt.enc');
hprocess.Parameters.Add('-pass pass:hello123');
// hProcess.Options := hProcess.Options + [poWaitOnExit, poUsePipes];
hProcess.Execute;
end;
However, when ran, the program gives the following output:
unknown option '-in C:\Users\SamSmith\secrets.txt'
If I run this directly from the command line, however, it works without problem:
openssl aes-256-cbc -a -in C:\Users\SamSmith\secrets.txt -out C:\Users\SamSmith\secrets.txt.enc -pass pass:hello123
Does anybody know what I'm doing wrong?
Thank you,
Sam