Discussion Locked

Hiding data in streams

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Tell us what you think about hiding data in streams, as featured in this week's Software Development e-newsletter. Have you experienced any problems with streams? How concerned are you about someone potentially misusing streams?

8 replies

by builder

Great article. Can anyone provide some sample code for use in the .NET framework? i.e. c# / vb.net?

by mike owens

Try it using the System.IO.File.CreateText and System.IO.File.OpenText functions. I haven't tried it but there is a good chance it will work.

by scottvs

This technique sounds useful if the file needs to be read using CreateFile and the "streams" need to be more or less hidden from the programmer,but the IStorage object which implements Compound Files (AKA Doc Files) is much more powerful and not much harder to use. Think of it as a file system within a file and you'll get the idea. This object and its relatives have been around for a long time. At one point MS Word used this as the format for DOC files. There is a program that comes with Visual Studio called DocFile Viewer that lets you open any file of this type and display the stuff inside of it.

by mike owens

I agree that there is some overlap in the capabilities but there meant for two different purposes. Streams are meant to be used to keep metadata about a file where compound files are meant to group various dissimiliar data into one location.

Forinstance if I want to maintain an executables configuration information. I could create an ini file or a use the registry to do this or I could use streams to maintain that data along side the executable and get the added benefit of keeping it out of sight of the user. Doing this with compound files would not be ideal.

by scott-mags

Here's the link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnw2k/html/ntfs5.asp

I found that the 'download source code' link at the top of the article appears to be misdirected to some VB.NET stuff totally unrelated - soI have yet to grab the add-on... but there were a couple of VBS scripts that were helpful in the meantime.

I, too, thought it was short sighted to mention the add-on, then not include a link. Perhaps it was due to the lack of a valid link on theMS site.

by rdoerrer

I would like to have some tools to list these secondary streams. Is there an API defined to access them?

Rainer

by mike owens

It appears that the Explorer add-on is no longer on MSDN. Be assured that it was there when I wrote the article. This is the curse of the web, you can never count on information remaining in place for an extended period of time.

This discussion is closed to new replies.