|
|||||||||||
|
Patch to rm.c & rm.1 to increase overwrite security
From: Alex Kirk <alex(at)schnarff.com>
Date: Mon Nov 25 2002 - 12:25:56 EST
Thank You,
>Submitter-Id: net
System : OpenBSD 3.2
Architecture: OpenBSD.i386
Machine : i386
< * Overwrite the file 3 times with varying bit patterns. --- > * Overwrite the file 33 times with varying bit patterns > * specifically designed to make data recovery exponentially > * more difficult. Note that no deletion process can > * *completely* remove a file, but that this process is as > * good as it gets. 299,304c303,313 < * XXX < * This is a cheap way to *really* delete files. Note that only regular < * files are deleted, directories (and therefore names) will remain. < * Also, this assumes a fixed-block file system (like FFS, or a V7 or a < * System V file system). In a logging file system, you'll have to have < * kernel support. ---> * > * Contributed in November 2002 by Alex Kirk <alex@schnarff.com>. 305a315,327 > #define HEX_VALS 27 > typedef unsigned char hexpattern[3]; > hexpattern vals[HEX_VALS] = { > {0x55, 0x55, 0x55}, {0xAA, 0xAA, 0xAA}, {0x92, 0x49, 0x24}, > {0x49, 0x24, 0x92}, {0x24, 0x92, 0x49}, {0x00, 0x00, 0x00}, > {0x11, 0x11, 0x11}, {0x22, 0x22, 0x22}, {0x33, 0x33, 0x33}, > {0x44, 0x44, 0x44}, {0x55, 0x55, 0x55}, {0x66, 0x66, 0x66}, > {0x77, 0x77, 0x77}, {0x88, 0x88, 0x88}, {0x99, 0x99, 0x99}, > {0xAA, 0xAA, 0xAA}, {0xBB, 0xBB, 0xBB}, {0xCC, 0xCC, 0xCC}, > {0xDD, 0xDD, 0xDD}, {0xEE, 0xEE, 0xEE}, {0xFF, 0xFF, 0xFF}, > {0x92, 0x49, 0x24}, {0x49, 0x24, 0x92}, {0x24, 0x92, 0x49}, > {0x6D, 0xB6, 0xDB}, {0xB6, 0xDB, 0x6D}, {0xDB, 0x6D, 0xB6} > }; 313a336 > int i, j, x, y; 330a354 > 339,345c363,381 < PASS(0xff); < if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET)) < goto err; < PASS(0x00); < if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET)) < goto err; < PASS(0xff); ---@@ -82,13 +82,11 @@ options. .It Fl P Overwrite regular files before deleting them. -Files are overwritten three times, first with the byte pattern -.Li 0xff , -then -.Li 0x00 , -and then -.Li 0xff -again, before they are deleted. +Files are overwritten thirty-three times, with the values suggested by +Peter Gutman in his 1996 USENIX paper Secure Deletion of Data from +Magnetic and Solid-State Memory for increased security, before they+are deleted. Note that this cannot provide complete destruction of +files, but that it is better than simply deleting them. .It Fl R Attempt to remove the file hierarchy rooted in each file argument. The [demime 0.98d removed an attachment of type application/pgp-signature] Received on Mon Nov 25 12:27:17 2002 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:38 EDT |
||||||||||
|
|||||||||||