1

Need some help with pgp file decryption anyone have an idea how to do it in c#? I have it implemented through process.start ("cmd.exe", command) but its not doing anything other than openning the C:\Windows\System32\IISExpress> the command line not getting executed,

any help is appreciated.

Code Snippet:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "pgp --decrypt " + inputfile+ " -r \"inputphrase\" --passphrase     \"passphrase\" --output " + outputfile+ ".txt";
process.StartInfo = startInfo;
process.Start();

Please suggest if there is way to achieve this.

4

1 回答 1

1

更好的方法是为 C#/.NET 使用 PGP(或相同的 OpenPGP)库。有免费和开源的(如 Bouncycastle),但它们缺乏支持、示例等。还有支持更好的商业库(如 SecureBlackbox),但它们需要一些钱。

于 2013-04-25T09:38:25.360 回答