In one of my program idea brainstorming sessions, I came up with the idea of writing a program to completely erase a floppy disk. The idea comes from government regulations. When deleting classified information from a disk, the disk must be written with all 1’s, then all 0’s, and then random 1’s and 0’s. After this, the disk can be re-formatted and considered clean enough for unclassified use.
It has been shown that reformatting a disk will not delete all of the information. Some bit patterns will remain, although they will be faint. The above procedure ensures that enough writes happen to the disk to completely wipe out any bit patterns on the disk.
To implement this program, I looked at Herb Schaaf’s Diskinfo program (QHJ #2). I got a few things figured out by looking at the code, but not enough to really give the program a try.
I have Herb a call to see if he would help me on the program, or write it himself. Herb, always ready to accept a challenge, sent me the program a few days later. I have taken what Herb wrote and made it more procedural and added a few touches of my own.
As is, the program will only write 1’s and 0’s. Adding the random 1’s and 0’s should be fairly easy to do if you really want to use this program. Just as with a data encryption program, I don’t think that my QL users will really need to use this program. It’s just a good exercise in programming and does demonstrate how to address every sector of a disk.
** wipedisk_ssb
**
** This program will write all 0's then all 1's
** to a disk and then format it. This is designed
** to totally delete all information from the disk.
** A format does not always delete the information
** at the lowest levels.
**
** Government regulations decrea that all disks
** that contain classified information go through
** a program like this to guarrentee that all of
** the information is gone for good.
BORDER #3,1,4
PAPER #3,2 : INK #3,1 : CLS #3
** TK2_EXT
** Write 0's to the whole disk
PRINT #3,"Writing Zero's To Disk"
null$ = FILL$(CHR$(0),512)
wipe (null$)
AT #3,6,0 : PRINT "Done"
PAUSE 200
CLS #3
** Write 1's to the whole disk
PRINT #3,"Writing One's To Disk"
full$ = FILL$(CHR$(255),512)
wipe (full$)
AT #3,6,0 : PRINT #3,"Done"
PAUSE 200
CLS #3
PRINT #3,"Formating Disk"
FORMAT "flp2_"
PRINT #3,"Disk Formatted"
STOP
DEFine PROCedure wipe (string$)
LOCal side, sector, track, in$
OPEN #4,'flp2_*d2d'
FOR track = 0 TO 79
FOR side = 0 TO 1
FOR sector = 1 TO 9
PUT #4\sector+(side*256)+(track*65536),string$
AT #3,1,2: PRINT #3,"Track : ";track
AT #3,2,2: PRINT #3,"Side : ";side
AT #3,3,2: PRINT #3,"Sector: ";sector
END FOR sector
END FOR side
END FOR track
CLOSE #4
END DEFine PROCedure wipe