pibcat
pibcat

Reputation: 94

PGP File Decryption

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.

Upvotes: 1

Views: 1179

Answers (1)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

The better way would be to use PGP (or OpenPGP, which is the same) library for C#/.NET. There are free and opensource ones (like Bouncycastle), but they lack support, examples, etc. Also there are better supported commercial libraries (like SecureBlackbox), but they cost some money.

Upvotes: 1

Related Questions