Secure rm (srm)
version 0.01
by: Todd Burgess
tburgess@eddie.cis.uoguelph.ca
http://eddie.cis.uoguelph.ca/~tburgess

Introduction

    srm is a tool designed to remove files securely. The way normal 
rm removes files is to remove the inode of the file (unlink) leaving
the data untouched. Even though the file can be considered deleted 
the data it contained has not been destroyed.
    srm will destroy the data prior to the file being deleted. It 
does this by overwriting the data with the character 0. While this
method is far from perfect it should at least stop most amateur 
snoops from viewing your data. 
    srm version 0.01 is being released as proof of concept but 
future versions should prove much more secure and contain more 
features. My goal is to create a program that contains all the 
functionality of rm only it destroys data.
    srm 0.01 is being released as a Linux version (although there is
no reason why it can not be used on other systems). In the future 
I am hoping I can also have it working on FreeBSD, NetBSD and 
NeXTStep systems.

Proof

   If you are skeptical and want proof that data is not destroyed try
these steps (assuming you have a 1.44MB disk and drive as your first
drive). Make sure you are logged in as root.

1. fdformat /dev/fd0H1440 (formats your disk)
2. mkfs -t ext2 /dev/fd0 (creates a ext2 filesystem on it)
3. mount -t ext2 /dev/fd0 /mnt (mounts the disk on /mnt)
4. echo "Hello World" > /mnt/hello.txt
5. strings /dev/fd0 (the strings "hello.txt" and "Hello World" will 
   be there)
6. rm /mnt/hello.txt (remove the file hello.txt)
7. repeat step 5 and you will see the same results.

If you want to see what srm does repeat the whole process only use 
srm instead of rm. What you will see for file contents is a string
of 0's.

Building srm

     Simply type make in the directory where all the files are and 
you will end up with a binary called srm. Play with it and 
if you want to use it copy it to /usr/local/bin .

Using srm
   
     This proof of concept will only remove one file at a time and
I intentionally have designed it this way. I know its a couple lines
of code but I am holding off on future development pending a positive
response from the Linux community. 
    To use it:
	srm filename
where filename is the file you wish to delete.
    Should you want do anything cute with it (removing multiple file)
I suggest you use find. For instance assume you wanted to destroy 
all the files in the directory /area51 then use the following command
line:
    find /area51 -exec srm {} \;
if you want confirmation before srm removes a file
    find /area51 -ok srm {} \;

Bugs

    srm does not check to see if what it is destroying is a regular 
file. srm assumes it is the only program accessing the file so if 
something tries to access something while srm is destroying it 
there could be bad results.

Future Development

    I have plans for future releases of srm. If you would like to 
see future versions of it please let me know. My e-mail is 
tburgess@eddie.cis.uoguelph.ca. If you also encounter bugs please
let me know. If you wish to contribute code I will gladly accept 
it and acknowledge your contribution. 

Shameless Self Promotion

    This is the point in the documentation where I shamelessly promote
some of my other Linux contributions. The first one is dj-printcap 
which allows Linux users to print text and Postscript on a HP Deskjet
printer. Find it at 
    ftp://sunsite.unc.edu/pub/Linux/system/printing/dj-printcap.tar.gz
The other one I did is the Small-Memory mini-HOWTO. I wrote it for 
those of condemned to use Linux on systems with small amounts of 
memory. Find it at:
    http://sunsite.unc.edu/pub/LDP/HOWTO/mini/Small-Memory.html


