CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 34
  1. #16
    Question,

    I was not aware Windows will use new sectors.
    It's very unlikely.

    When you use CreateFile and read and write parts of the file, no new sectors should be used.

    Therefore the rewrite should be very safe.

    Norton wipeinfo does a similar job.

    It also supports multiple writes since the manufacturer can (sometimes) read up to 8 writes(!)
    That's what i heard anyway, it's a magnetic thing.
    Last edited by Edwin Knoppert; September 4th, 2003 at 09:48 AM.

  2. #17
    Join Date
    Jan 2002
    Location
    Quebec/Canada
    Posts
    124
    If your data are so critical and secret, I would recommend to use some kind of disk encryption before anything else so that someone who get access to your files won't be able to read the real stuff without you keyphrase.

    -----
    Heulsay

  3. #18
    Join Date
    May 2002
    Location
    Huntington, WV
    Posts
    303

    Re: Moreover...

    Originally posted by Cimperiali
    When someone comes and take your Hd to lok for data, usually he/she does not put your hd in a new hardware as the primary disk, but attach it as slave...Thus your program will not run at all, as the Os is on another disk where your program does not trig...
    It would be easyer to attach a small bomb inside Pc, so that if soenoe try to open, your bomb explodes...

    eh, never thought about that... wonder how cops do it when they comfiscate a HD... (or actually i think they usually clone them. that's what i saw on some tv show anyways.)

  4. #19
    Join Date
    May 2002
    Location
    Huntington, WV
    Posts
    303
    can anyone suggest encryption software?

  5. #20
    Join Date
    May 2002
    Location
    Huntington, WV
    Posts
    303
    actually, encryption wouldn't help. cause i need to be able to use these files without decrypting them all the time.


    but anyways, as for overwriting the files, when you say writing 0s to the end of the file, do you mean like, opening the file, getting the length, then writing that many 0s to it and closing it?


    like this:

    On Error Resume Next
    Dim iFileNumber As Integer
    Dim i As Integer
    iFileNumber = FreeFile
    Open "C:\test.txt" For Output As #iFileNumber
    Print #iFileNumber, String$(FileLen("C:\test.txt"), Chr$(0));
    Close #iFileNumber

    or is that totally wrong?

  6. #21
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487
    Sorry for the interruption but...

    Simply, open the file for output will re-create the file and then finally delete the file. I think this will surely hard to recover the data or nothing can be revied at all..
    Code:
    hFile = FreeFile()
    Open "c:\myConfi.txt" For Output As #hFile
    Close #hFile
    Kill "c:\myConfi.txt"
    But as the majority said that overwriting the file would be much safer..
    Code:
    hFile = FreeFile()
    Open "c:\myConfi.txt" For Binary As #hFile
    Put #hFile,, String$(LOF(hFile), vbNullChar)
    Close #hFile
    Kill "c:\myConfi.txt"
    Goodluck!
    Busy

  7. #22
    Join Date
    Feb 2003
    Location
    Greece
    Posts
    533

    Overwriting methods

    As many of us said, its safer to overwrite first the file before deleting it.

    Tinbum747 said that the OS may select another physical location for the empty data (zeroes), and then replace the pointers in FAT. This is understandable specially if we replacing a file with data of a different size than the original and OS determines that the original location not matches at all the data length. So the real file even without header can still stay there.

    Another member said that Windows is not that "smart" or better is a bit lazy to do such a thing. So it may still use the same physical disk area to overwrite the contents.

    Thread1 uses a single PUT sending a large amount of data in one single method call to the file. This is possible to confirm what Tinbum747 says, I dont recall what PUT really does and behaves (disk area reservation, FAT handling, etc).

    In pure logic, if you open a file for binary, select a specific byte and replace it with one PUT method and close it, will NOT use another physical disk area. So by using many PUTs (sending 1-byte or to not be that slow small packets) maybe its safer to confuse the OS to not use other location. Just an idea for bringing closely the "wiping" thing.
    - Better live in the digital world -

  8. #23
    Join Date
    Jan 2002
    Location
    Quebec/Canada
    Posts
    124
    Well for encryption, if I remember correctly, you can have some sort of os level encryption system for your files, so any software / access to files is done as usual. I also think that you can do that with some windows professional (2000 and XP and maybe nt) over a ntfs filesystem.

  9. #24
    Join Date
    May 2002
    Location
    Huntington, WV
    Posts
    303
    ok, thanks a lot guys. i'll use that code Thread1. i guess put the directory's contents in an array and loop through each file.

  10. #25
    Join Date
    May 2003
    Location
    Norway
    Posts
    1
    I have found this at SysInternals. It's C-code, but maybe this could help you.
    SDelete: Securely overwrite your sensitive files ...

  11. #26
    Join Date
    Feb 2003
    Location
    Greece
    Posts
    533

    Wipe a file (assembly)

    This may be usefull anyway:

    http://www.cybertrails.com/~fys/wipeit.htm
    - Better live in the digital world -

  12. #27
    Join Date
    Dec 2001
    Posts
    6,332
    This is certainly an interesting topic. I think opening a file for Binary Access Write and writting in zero's, then deleting like Thread1 suggested is a good way, especially for hidding data from the typical user. However, close inspection might still reveal filenames, or parts thereof, so I would suggest renaming the file to some random string before deleting it. That should further hide the data, if any is actually left at all, IMHO.

    Again, as has been pointed out, connecting the drive as a slave, or booting to a command prompt would prevent your program from running, so the files would be accessable. If I really wanted to keep data from others, I would put it on floppy, SuperDisc, memory stick, CDRW, or other removable media.

    Just how many people have access to your system anyway? If it's your own system, just don't let others use it. If it's not your system, you shouldn't be keeping super-sensitive data on it anyway.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  13. #28
    Join Date
    Nov 2005
    Posts
    75

    Re: Nice, dtv!

    only the way destroy whole data from the HDD. get a hammer. and hit with it.

  14. #29
    Join Date
    Sep 2000
    Location
    Indianapolis
    Posts
    6,758

    Re: Nice, dtv!

    Quote Originally Posted by jdavide
    only the way destroy whole data from the HDD. get a hammer. and hit with it.

    Even that is not guaranteed to destroy all data on all parts of the hard drive...

    Brad!
    -----------------------------------------------
    Brad! Jones,
    Yowza Publishing
    LotsOfSoftware, LLC

    -----------------------------------------------

  15. #30
    Join Date
    May 2002
    Location
    Huntington, WV
    Posts
    303

    Re: Nice, dtv!

    reviving a three year old thread just for that jdavide?...

Page 2 of 3 FirstFirst 123 LastLast

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

Featured