LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-31-2006, 08:00 AM   #1
qwerty
Member
 
Registered: Feb 2005
Location: England
Distribution: Ubuntu 5.10
Posts: 80

Rep: Reputation: 15
writing a simple file shredding program


Hi, I'm trying to write a simple file shredding program. I want the program to be cross-platform so using the 'shred' utility is ruled out.

I have seen some programs using the 'dd' command to overwrite the file with random data. Does this command work differently than just writing over the file with random bits, i.e. can I just use a FileOutputStream in Java to achieve the same effect as using 'dd'.

If the above is not possible is there a DOS equivalent to 'dd'?

Thanks
 
Old 01-31-2006, 08:40 AM   #2
BinJajer
Member
 
Registered: Sep 2005
Location: Warsaw, Poland
Distribution: Slackware 10.2, Caldera OpenLinux 3.1, Corel Linux (Thanks xhi!), Debian GNU/HURD etc...
Posts: 296
Blog Entries: 1

Rep: Reputation: 30
Ummm... DOS is not like an UNIX shell. The utilities there are very scarce. But maybe it's possible... but I don't think so.
 
Old 01-31-2006, 11:05 AM   #3
qwerty
Member
 
Registered: Feb 2005
Location: England
Distribution: Ubuntu 5.10
Posts: 80

Original Poster
Rep: Reputation: 15
Thanks for that.

I've spent the afternoon writing an app that just uses FileOutputStream to overwrite the file X number of times. This seems to do the trick and will be cross-platform.

Don't think I'll bother with DD or a windows command now because this method seems to work and makes it truly cross-platform
 
Old 01-31-2006, 11:31 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Easier: Get a copy of Darik's boot and nuke. Boots from floppy, and includes DOD-spec routines for "shredding" classified data.
 
Old 01-31-2006, 11:50 AM   #5
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Rep: Reputation: 31
Quote:
Originally Posted by pixellany
Easier: Get a copy of Darik's boot and nuke. Boots from floppy, and includes DOD-spec routines for "shredding" classified data.
Maybe, but DBAN will wipe the attached drives. The thread author is only looking to securely remove a single file or set of files.

In essence, overwriting with random data should be fine. Be sure to consider other aspects such as slack space. There are 'secure file deletion' threads all over this forum, as well as tools all over the internet.
 
Old 01-31-2006, 12:59 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by int0x80
Maybe, but DBAN will wipe the attached drives. The thread author is only looking to securely remove a single file or set of files.
Sorry--that's not how I read it. Normally, one does not need to shred files if one is keeping control of the computer ( or their account). I only use DBAN when selling a box, turning it back to the IT folks, etc.
 
Old 01-31-2006, 01:21 PM   #7
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Rep: Reputation: 31
Likewise. DBAN sure is a great util though
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing a c program in linux which plays an'.wav' file stephenwalter Programming 8 07-08-2005 11:37 PM
writing simple acpi program bucovaina78 Linux - Laptop and Netbook 1 04-27-2005 07:46 PM
Need help writing a simple program justintime32 Mandriva 8 03-04-2005 08:12 PM
Help writing a simple script Garibaldi3489 Linux - General 10 12-18-2004 06:22 PM
writing a simple file system in linux Deepthi_57 Linux - Newbie 1 05-03-2004 12:42 AM


All times are GMT -5. The time now is 06:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration