1. If SeekFile goes past the end of the file, it doesn't error out, it simply returns a negative number. The EOF should then be detected before the next WRITEINT in the loop. It isn't being detected, and this is irrelevant, as it's not writing any data at all for some reason?
2. I want to "overwrite" the current data. It's a file shredder. I've got 27 file passes to write. It's working, with files of limited file size (as with the second example), but over 500 megs or so - it just errors out as filesize() returns a negative value (because it's a large, signed int). The passes I'm writing:
.passdata
Data 27
Data 1,0,1,1431655765,"01010101 01010101 01010101","0x55"
Data 1,0,1,-1431655766,"10101010 10101010 10101010","0xAA"
Data 0,1,1,-1843115630,"10010010 01001001 00100100","0x92 0x49 0x24"
Data 0,1,1,1234314313,"01001001 00100100 10010010","0x49 0x24 0x92"
Data 0,1,1,608801316,"00100100 10010010 01001001","0x24 0x92 0x49"
Data 1,1,0,0,"00000000 00000000 00000000","0x00 0x00 0x00"
Data 1,0,0,286331153,"00010001 00010001 00010001","0x11"
Data 1,0,0,572662306,"00100010 00100010 00100010","0x22"
Data 1,1,0,858993459,"00110011 00110011 00110011","0x33"
Data 1,0,0,1145324612,"01000100 01000100 01000100","0x44"
Data 1,0,1,1431655765,"01010101 01010101 01010101","0x55"
Data 1,1,0,1717986918,"01100110 01100110 01100110","0x66"
Data 1,0,0,2004318071,"01110111 01110111 01110111","0x77"
Data 1,0,0,-2004318072,"10001000 10001000 10001000","0x88"
Data 1,1,0,-1717986919,"10011001 10011001 10011001","0x99"
Data 1,0,1,-1431655766,"10101010 10101010 10101010","0xAA"
Data 1,0,0,-1145324613,"10111011 10111011 10111011","0xBB"
Data 1,1,0,-858993460,"11001100 11001100 11001100","0xCC"
Data 1,0,0,-572662307,"11011101 11011101 11011101","0xDD"
Data 1,0,0,-286331154,"11101110 11101110 11101110","0xEE"
Data 1,1,0,-1,"11111111 11111111 11111111","0xFF"
Data 0,1,1,-1843115630,"10010010 01001001 00100100","0x92 0x49 0x24"
Data 0,1,1,1234314313,"01001001 00100100 10010010","0x49 0x24 0x92"
Data 0,1,1,608801316,"00100100 10010010 01001001","0x24 0x92 0x49"
Data 0,1,0,1843115629,"01101101 10110110 11011011","0x6D 0xB6 0xDB"
Data 0,1,0,-1234314314,"10110110 11011011 01101101","0xB6 0xDB 0x6D"
Data 0,1,0,-608801317,"11011011 01101101 10110110","0xDB 0x6D 0xB6"
From left to right:
1/0 - Destroy RLL1 magnetic scanning (Scanning Probe Microscopy)?
1/0 - Destroy RLL2 magnetic scanning (Magnetic Force Scanning Tunnelling Microscopy)?
1/0 - Destroy MFM magnetic scanning (Magnetic Force Microscopy)?
INT - Int to write to file, resulting in actual bit mask.
"0100100etc" - Binary representation of the bit mask
"0xCCetc" - Hexidecimal representation of the bit mask
Most of the "file-shredding" programs out there, use "DoD level file destruction!" as if it's some great thing. At only 7-9 levels of overwriting, unfortunately, this only stops SPM. The proclaimed "DoD Standard" is a decade old. There are two newer scanning functions out there which walk all over programs like "Evidence Eliminator", etc. My program destroys data beyond any currently known recovery methods except.. sigh.. it isn't work on files over 500 megs because of this bug I can't work out. :)
The README if anyone's interested in helping sort this error out:
============================================================
FileBLITZer 1.0
Copyright (c) 2004, Kinnear Penman Jnr
============================================================
This document contains important usage and licensing
information that you'll need to read to get the most
out of the software, and to ensure your files are
properly shredded.
Please read in its entirety, then click the I AGREE
button below.
CONTENTS
- Introduction
- What is involved in shredding
- How does it work
- What you need to know
- Licensing
------------------------------------------------------------
INTRODUCTION
FileBLITZer is a free file-shredding utility created
in the BlitzPlus programming language. BlitzPlus is a
BASIC syntaxed Windows API programming language
created by Blitz Research Ltd.
FileBLITZer provides a level of file destruction that
exceeds even many commercial file shredding software
such as Evidence Eliminator. While most file shredding
programs provide a level of data destruction claimed
to be at "US DoD" standards - this standard is by far
out of date, and is dangerous to be relied upon.
------------------------------------------------------------
WHAT IS INVOVLED IN FILE SHREDDING
Regular "DoD" file shredding invoked by most free and
commercial data destruction software involves between
7-9 bit writing passes over the length of the file.
This guarantees the data cannot be recovered by any
software means, and also rules out recovry via electron
microscopes with the old Scanning Probe Microscopy
method.
However, times have changed. Magnetic Force Microscopy
(MFM) techniques currently in use OUTDATE the "DoD"
effective file-shredding methods. And don't get lured
into thinking "But I'm not doing anything illegal, so
I don't need NSA-level shredding, they're never going
to be accessing my stuff". Wrong! MFM readers can be
built for under $2000. Every data recovery company has
one. A snooping flatmate or employer can have all your
deleted (and even DOD-Shredded) data for a mere $100
down at the local data recovery co.
Futhermore, as hard-drive manufacturers pack more and
more data onto high-density platters, they start using
methods of using neighbouring bits to record additional
data. Even if your file is completely shredded, the
information can be read from these neighbouring bits
using Magnetic Force Scanning Tunneling Microscopy
(STM). Now we ARE talking NSA-level. :)
Furthermore, the file entry in the FAT table can give
many clues to investigations. Some shredding programs
merely delete the file after it is "shredded", leaving
the original file name and size information intact.
Yet, FileBLITZer provides hope. :)
------------------------------------------------------------
HOW DOES IT WORK
FileBLITZer performs (up to) 35 individual passes on
the file. Not 7. Not 12. 35! And I'm not talking mere
random data or 0000s and 1111s.
To truly delete a file forever, you need to align the
magnetic field of the file and neighbouring bits, back
to nothing. Neither 0 or 1. Of course every bit has to
be either a 0 or 1 as we are writing (not using a
degausser) so this instead has to be done using a
careful sequential series of bit masks which "pull" the
magnetic in both directions to equilibrium. The
particular series of bit-masks required is known as
the Gutmann-Method, after Peter Gutmann, Department of
Computer Science, Auckland University, New Zealand.
FileBLITZer is broken down into the following steps.
- You select which file(s) you wish to "blitz".
- The total byte-length is calculated and shredding
begins.
- 4 passes of random data are written initally. This
is merely a precaution.
- 27 (at most, depending on what shredding level you
have selected) bit-mask passes completely overwrite
the data beyond any recovery means known to modern
science.
- 4 passes of random data are written at the end of
the alignment process to provide "filler" data.
- The filenames are overwritten 35 times with the
Gutmann method so even their NAMES cannot be
recovered.
- The files size entry in the FAT table is rewritten
50 times with random sizes.
- The data in memory which housed the information of
what files are being shredded in RAM is also
shredded by bitmask. RAM can store information even
after your computer is closed down. This removes
any chances of that happening. I know of no other
program which takes this precaution.
Now, the file is unrecoverable even by the most
advanced magnetic force electron scanning methods.
Nobody even knows the file name or file size. Even the
system RAM in use has no idea what just happened. :)
------------------------------------------------------------
WHAT YOU NEED TO KNOW
Firstly - FileBLITZer is not fast. In fact, it's
painfully slow, due to the way Blitz accesses the disk.
But it's secure.
If you're running any automatic data-backup software in
the background, such as Windows System Restore, you need
to disable it. What's the point in shredding a file if
you've got another program making backups of all your
data beforehand to make sure you don't delete anything
important?
If you ARE using a software recovery program, then not
only will you need to disable it, but you'll need to
"BLITZ" the backup files. Simply disabling it means the
backup files will just stop being used. They're still
there and data can still be recovered.
If you are using Norton Unerase or Norton RecycleBin
Protection, it is highly recommended you disable these
utilities. There is no reason why having them active
should cause any problems, but maybe they've put in
some new-fangled thing to make protected backups of
files that look like they're being "overwritten" by a
virus. I don't know - but just to be safe. :)
------------------------------------------------------------
LICENSING
FileBLITZer is free for everyone. However, it is only a
proof-of-concept program. It should not be taken
seriously, and is used at your own risk. If it deletes
all your data, fries your hardware, sets fire to your
cat, or any other unforseen mishaps - I can't be held
responsible. You're under no obligation to use this
software, and doing so is your own choice.
You have been warned.
The source-code is provided, ONLY for review purposes.
You may not re-use, re-package or re-distribute the
source code in any other form. You cannot alter it.
You cannot sell it. You cannot post it to IRC. You
get the point.
If you want to port FileBLITZer to another (faster)
language, then please get permission first. Likewise,
with comments, requests, email me:
black3d@...
------------------------------------------------------------+BlackD