Click here to Skip to main content
15,671,266 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
I have program steghide,
Steghide is a steganography program that is able to hide data in various kinds of image- and audio-files. The color- respectivly sample-frequencies are not changed thus making the embedding resistant against first-order statistical tests.
http://steghide.sourceforge.net[^]

I try set parameters

System.Diagnostics.Process.Start("steghide.exe", "-sf" "picture.jpg");
I run the program. And it shows
steghide extract -sf picture.jpg
  Enter passphrase:
  wrote extracted data to "secret.txt
".

How to pass parameter password
Posted

1 solution

First, read the documentation of "steghide.exe". You need to be able to pass a pass phrase as another parameter. If this command line parameter is not available, the solution is still possible, see below.

But first, look at all of the methods System.Diagnostics.Process.Start at http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx[^].

There is not such signature you are trying to use, the code won't compile. You can use Process.Start(string, string):

C#
System.Diagnostics.Process.Start("steghide.exe", "-sf picture.jpg");


In this usage, all parameters go in one string, separated with the blank character: http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx[^].

Now, coming back to the situation when there is no a command line parameter for your pass phrase:

It's worse, then you need to simulate the user input. This is done by using System.Diagnostics.Process.StandardInput. You will need to redirect it. Do do this, you will need to use the process Start(ProcessStartInfo) method.

Make sure you prescribe redirection option in your process start info, see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.startinfo.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx[^].

You will find a code sample with redirection here: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardinput.aspx[^].

You need to write your value of the pass phrase to the redirected string where required.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900