views:

358

answers:

3

I wanted to make a vb.net version of this trick used to hide files in pictures: http://www.online-tech-tips.com/computer-tips/hide-file-in-picture/

I don't have any idea on how to do this, but first is it possible? In my mind I have to use an open file dialog box to do this.

A: 

If you are writing a command-line program, you would typically take filenames as command line arguments, rather than displaying a File Open dialog. E.g. the user would type:

hidefile c:\files\secret.txt c:\pics\mypicture.jpg

and your program would extract those filenames rather than prompting for them. To do this, use Environment.GetCommandLineArgs or the string[] args argument to the Main method.

However, if you do want to display a File Open dialog from a command line app, you can do so: you just need to add a reference to the System.Windows.Forms assembly.

itowlson
+1  A: 

The technique you are talking about is called Steganography, if you are talking about hiding files, there is an excellent article about this on CodeProject, and how to do it. The article covers a framework on how to achieve what you are looking for, in fact, if you check the author's articles, you will see that the author has written numerous articles covering all aspects of steganography.

Hope this helps, Best regards, Tom.

tommieb75
I'd also add that while this works well, you need to be careful about the file formats you use, MS bitmap (.BMP) files work best as they are stored as a stream, while things like .JPG and .PNG, one row of the image can effect the ones above and below it
Scott Herbert
A: 

If you're referring to the copy /b file1 + file2 file3 bit, this is simply a question of file concatenation, and can be achieved fairly easily using the standard .NET System.IO libraries (by successively copying one file stream and then the other into a new file stream).

Edit: Alternatively, just use a more direct approach.

Will Vousden