encryption - PGP Encrypt from C# using GnuPG -


I am trying to encrypt the incoming document in C #, and I use GnuPG with input redirection I am here. I need to use the -se (sign and encrypt) in a single step, in which the passphrase is required to be entered. But for some reason, the input redirection is not working. appreciate your help. Control is going to block other I'm not sure whether the deadlock for input or the hair process (GPG.exe) is awaiting.

  pgpproc = new process (); Pgpproc.StartInfo.FileName = exeFilePath; Pgpproc.StartInfo.RedirectStandardOutput = false; Pgpproc.StartInfo.RedirectStandardInput = True; Pgpproc.StartInfo.UseShellExecute = false; Pgpproc.StartInfo.Arguments = "-a -oC: \ PGpsitting \ Output .pgp -se -r Recipient ID: \ PGPStaging \ input.txt"; Pgpproc.StartInfo.CreateNoWindow = true; Pgpproc.start (); StreamStateWriter = pgpproc.StandardInput; MyStreamWriter.Write ("*****"); MyStreamWriter.Close (); If (pgpproc.WaitForExit (waitime)) {// success} other {// failure pgpproc.Kill (); Pgpproc.WaitForExit (); }  

`

The first thing you can do is redirection See yourself the console to know what's roaring / waiting after this, try adding new-line characters (\ n or 0x13 or 0x130x10, try all versions) at the end of the password - When you write something, you press Enter to pass it, and you have to do it here too. Finally, you can use to perform operations without external applications.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -