I am using C# and PGP Command Line tool for decrypting symmetric encrypted pgp files.
As far as I know, I can decrypt files using this command:
pgp --decrypt --symmetric-passphrase 123 --output D:\lic_mmm.txt D:\lic.txt.pgp
That decrypts D:\lic.txt.pgp to D:\lic_mmm.txt with passphrase as 123.
This works fine when using cmd, now I want to automate this process in C#.
My code looks like the code below.
But this is not working, the command window appears and then hides showing a message: "Invalid argument"
What is wrong with the code?
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.WorkingDirectory = @"D:\PGP Command Line";
string args = @"--decrypt --symmetric-passphrase 123 --output D:\lic_mmm.txt D:\lic.txt.pgp";
p.StartInfo.FileName = "pgp";
p.StartInfo.Arguments = " " + args;