#!/bin/bash # Disk Wipe (dw) is a simple tool to securely destroy data on a disk by writing # random data on it. # # Copyright (C) 2005, Ray Soucy # University of Maine, Fort Kent (UMFK) # # This program is Free Software as defined by the GNU General Public License # version 2 or later. See COPYING for details. # # This tool will prevent forensic software from retrieving data from a disk, # but will not offer protection against Magnetic Force Microscopy (MFM) # recovery techniques. # # This should not be used for military data destruction. The DoD recommends a # minimum of seven wipes with random data. This script can easilly be # modified to do this. # Usage: dw # Example: dw /dev/fd0 (wipe a floppy disk) instructions() { echo echo "Disk Wipe (dw)" echo "Copyright (C) 2005, Ray Soucy " echo echo "Disk Wipe will write random data to a device to avoid data recovery " echo "techniques." echo echo "Usage: dw " echo "Example: dw /dev/fd0 (wipe a floppy disk)." echo echo "Device reference:" echo echo " IDE Primary Master: /dev/hda" echo " IDE Primary Slave: /dev/hdb" echo " IDE Secondary Master: /dev/hdc" echo " IDE Secondary Salve: /dev/hdd" echo return } disk-wipe() { echo "WARNING: All data on $1 will be overwritten." echo "Continue? (y/N)" read confirm if [ $confirm == "y" ] || [ $confirm == "Y" ] then device=$1 else device="/dev/null" exit 0 fi # urandom isn't truely random, but because /dev/random takes a very long # time to come up with truely random data we use /dev/urandom instead. dd if=/dev/urandom of=$device bs=512 # after we write random data to the file we zero it out dd if=/dev/zero of=$device bs=512 return } if [ $# == 1 ] then disk-wipe $1 else instructions fi