Results 1 to 6 of 6

Thread: Wiping(not just deleting) a file

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Australia
    Posts
    1

    Talking

    umm

    Q: How would one(me) go about coding to WIPE(ala title not delete) a file(in VB6), i would imagine there might be an api call(i hope), i just dont know what it is so any help would be highly apreciated =)

    A: Thats ur job duh!!!

    Anyways thx in advance.
    Can no one think anything better than hello world!!! ¿?¿?¿?¿?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    What's wipe?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest

    Wink

    find out the length of the file you want to get rid of (the term you are looking for is "shred") and then overwrite it with an equal amount of zeroes, then delete it in the normal way, no trace of the original should be left behind. Or thats the way it seems to me.

    If anyone knows another better way, then i'll stand corrected

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Thumbs up Aha!

    If that's called Wipe then:
    Code:
    Open File for output as #1
    Close #1
    Kill File
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    just adding alittle to the definition of shred / wipe...

    you need to ensure when you write over the file with new data that you write over the exact same place on the hard disk (sectors,clusters,tracks,whatever).
    if (and in windows its very common) the file is broken into different parts on the harddrive you need to locate every part and overwrite it.

    i dont know for sure, but if you just write over the file in windows, its possible that windows will just create a whole new file location on the harddrive and just change the (FAT entry) i think.

    i think the best way is to use low level disk writing commands (probabily not in vb) a .com file might work if you can make one.

    i hope this helps.
    ______________

  6. #6
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I got this code from Matthew Gates a while ago... I modified it a bit (it's stated it's only save when you overwrite it 7 times or something )


    Code:
    Sub TerminateFile(sFileName As String)
        Dim Block1 As String, Block2 As String, Blocks As Long
        Dim hFileHandle As Integer, iLoop As Long, offset As Long
        Dim x As Integer
        'Create two buffers with a specified 'wipe-out' characters
        Const BLOCKSIZE = 4096
        Block1 = String(BLOCKSIZE, "X")
        Block2 = String(BLOCKSIZE, " ")
        'Overwrite the file contents with the wipe-out characters
        hFileHandle = FreeFile
        For x = 0 To 6
        Open sFileName For Binary As hFileHandle
            Blocks = (LOF(hFileHandle) \ BLOCKSIZE) + 1
            For iLoop = 1 To Blocks
                offset = Seek(hFileHandle)
                Put hFileHandle, , Block1
                Put hFileHandle, offset, Block2
            Next iLoop
        Close hFileHandle
        Next x
            'Now you can delete the file, which contains no sensitive data
        Kill sFileName
    End Sub
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width