Using Text Files to Hide Confidential Data in Windows

Posted on March 22, 2010 at 5:30 am

There are many ways to secure information in files, including using Omziff, which is discussed in our earlier post, Encrypt and Password Protect Text Files for Free.

Here we discuss a method of securing data using an ordinary text file.

Using the Alternate Data Streams support that has been included in Windows since the introduction of the NTFS file system in Windows 2000, you can store data “behind” a filename with the use of a stream name.

You cannot access this hidden stream anywhere in Windows. It is not visible in the file system. You can only access it using the “secret key,” which is just the stream name you assigned.

Alternate streams in a file

The alternate data streams are like secret compartments within a file that can be accessed using a secret code you specify as the stream name. This is not as secure as other methods of encrypting data, but it’s easy and convenient.

NOTE: This method of hiding data in text file streams only works on computers with hard drives formatted using NTFS.

Before we begin, you need to download a free utility for working with file streams. Download streams.exe from

http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx.

You may save the file wherever you want to. It can be run from any location.

Creating a Secret Compartment for Hiding Data

To hide data in a text file stream, select Run from the Start menu, enter cmd in the Open edit box. Click OK.

Opening a Command Prompt

A Command Prompt window displays. Enter the following command at the prompt:

notepad filename.txt:mysecretword.txt

Entering notepad command with secret word

You can pick any secret word you want for “mysecretword.” There should be no space between the colon and the text of the filename or the secret word.

When you press Enter, Notepad opens and you are asked if you want to create a new file. This occurs even if filename.txt already exists, because mysecretword.txt does not yet exist.

Create new file dialog box

Enter your private data into the file in Notepad and save the file.

Private data entered into file

The file size does not change when you add text to a file stream.

File size does not change

You can open the text file by double-clicking on it, like a normal text file and enter text in the file.

Normal text file

You can use the command line again to add a second “hidden compartment” with a different name:

Another secret compartment

Again, you are asked if you want to create a new file because anothersecretword.txt does not yet exist. You can now add more confidential data.

More confidential data

Each of these secret files are unique and will not change the others or the main file.

NOTE: Once you create a hidden stream, that stream is not technically part of the main file. You cannot copy the main file to a different location and access the streams in that new location. For that capability, see our previous post, Encrypt and Password Protect Text Files for Free.

Viewing the Secret Data

To view the data you added to the stream on a file, you must use the command line to pipe the data into the more command. In the command window, type the following command:

more < filename.txt:mysecretword.txt

Viewing secret data

The secret data we added to the file stream is output to the console.

Adding More Data to Existing Hidden Streams

If you decide you want to add more text to a hidden stream you already created, you can use the same command to open the hidden stream in Notepad, as we discussed above. For example, to add text to the mysecretword stream, we would type the following text:

notepad filename.txt:mysecretword.txt

This opens Notepad and opens the mysecretword stream for you to edit. Add the desired text and save the file.

Detecting Hidden Streams

If you have forgotten the secret word you used to create a hidden stream on a text file, you can find out what hidden streams are on a file by using the streams.exe utility. Type the following on the command line, replacing the path with the location where you saved streams.exe when you downloaded and unzipped the utility.

c:\users\lori\downloads\streams.exe filename.txt

Detecting hidden streams

The filename.txt file has two streams defined, anothersecretword.txt and mysecretword.txt.

NOTE: This is why this method of protecting data is not as secure as other methods. Anyone can access your secret words if they have your file and streams.exe. Then, they can use the commands in this post to access your private data.

This method combined with encrypting the main file using an encryption utility, such as Omziff, would make it more secure.

Deleting Hidden Streams

If you decide you don’t want the hidden streams associated with a text file anymore, you can delete all streams in a text file. Unfortunately, you cannot delete some of the streams. You can delete all of them or none of them.

To delete the streams in a text file, type the following syntax on the command line:

c:\users\lori\downloads\streams.exe –d filename.txt

Deleting streams in a file

Just remember that this is not a secure way of protecting your data. For more security, use special encryption software, such as Omziff or Truecrypt. We just found it interesting and thought it might come in handy. Something new to learn.

by Lori Kaufman

» Filed Under Computer Tips

Related Posts

Comments

Please post your comments/suggestions!