Wipe - Linux tool for erasing files

Antivirus, forensics, intrusion detection, cryptography, etc.
Post Reply
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

Wipe - Linux tool for erasing files

#1 Post by labbe5 »

wipe is a cli-tool that is in most, if not all Linux repositories which will help you erase your sensitive files securely.

As root, open a terminal where your folder or files to erase are.

For a folder to erase : #wipe -r name-of-your-folder
For a file to erase : #wipe name-of-your-file

Files and folders are not just removed, they are overwritten numerous times, and become unretrievable by forensic investigation tools.

The best folder where to manage your sensitive files is temp folder.

Wiping a partition :
Randomize the drive/partition using a randomly-seeded AES cipher from OpenSSL.
As root :
#DEVICE="/dev/sdX"
#PASS=$(tr -cd '[:alnum:]' < /dev/urandom | head -c128)
#openssl enc -aes-256-ctr -pass pass:"$PASS" -nosalt </dev/zero | dd bs=64K ibs=64K of=$DEVICE status=progress

The command above creates a 128 byte encryption key seeded from /dev/urandom. AES-256 in CTR mode is used to encrypt /dev/zero's output with the urandom key. Utilizing the cipher instead of a pseudorandom source results in very high write speeds and the result is a device filled with AES ciphertext.

The block size is set to 64K above as it is usually faster than the default 512 bytes, and yields nearly optimal transfer rates across a range of hardware.

https://wiki.archlinux.org/index.php/Se ... ed_example

Further reading :
Secure Deletion on Solid-state Disks (SSDs), USB Flash Drives, and SD Cards
Due to the way SSDs, USB flash drives, and SD cards work, it is difficult, if not impossible, to securely delete both individual files and free space. As a result, your best bet in terms of protection is to use encryption. That way, even if the file is still on the disk, it will at least look like gibberish to anyone who gets ahold of it and can’t force you to decrypt it. At this point in time, we cannot provide a good general procedure that will definitely remove your data from an SSD.
https://ssd.eff.org/en/module/how-delet ... inux##SSDs
Last edited by labbe5 on Mon 05 Aug 2019, 11:30, edited 2 times in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi, labbe5.

Great suggestion!

Except this upupbb-light does not have the wipe utility.
And I suspect a lot of other Pups do not have it either.

Any idea where we can get it?

TIA.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#3 Post by s243a »

musher0 wrote:Hi, labbe5.

Great suggestion!

Except this upupbb-light does not have the wipe utility.
And I suspect a lot of other Pups do not have it either.

Any idea where we can get it?

TIA.
As a side note, depending on the storage media and the file system, one should also encrypt any sensitive file (or alternatively file system) because depending on the media and file system it may be the case that shredding utilities might not work as expected. For example wear reduction algorithms (or journaling?) might leave old remnants of the file in unexpected places.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

Hello all.
s243a wrote:( ... ) shredding utilities ( ... ).
This pup does have the shred utility, however.
What's the difference between shred and wipe?

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#5 Post by s243a »

musher0 wrote:Hello all.
s243a wrote:( ... ) shredding utilities ( ... ).
This pup does have the shred utility, however.
What's the difference between shred and wipe?

BFN.
Entropy?

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#6 Post by fabrice_035 »

Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Re: Wipe - Linux tool for erasing files

#7 Post by Flash »

labbe5 wrote:...Files and folders are not just removed, they are overwritten numerous times, and become unretrievable by forensic investigation tools....
Is that really true if the files are fragmented all over a hard disk?
I guess if the files were encrypted in the first place it wouldn't make much difference.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

s243a wrote:
musher0 wrote:Hello all.
s243a wrote:( ... ) shredding utilities ( ... ).
This pup does have the shred utility, however.
What's the difference between shred and wipe?

BFN.
Entropy?
Sorry, not getting it, s243a.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#9 Post by bigpup »

Any idea where we can get it?
wipe is a cli-tool that is in most, if not all Linux repositories
Search Puppy Package Manager(PPM) for wipe.

Found and installed from PPM.
root# wipe -v
This is wipe version 0.23.

Author: Oguz Berke Antoine Durak.
Author's e-mail address: echo berke1lambda-diode2com|tr 12 @.
Web site: http://lambda-diode.com/software/wipe/
Release date: 2016-11-03
Git version: (unknown, compiled without git)

Based on data from "Secure Deletion of Data from Magnetic and Solid-State
Memory" by Peter Gutmann <pgut001@cs.auckland.ac.nz>.
root#
Here it is at Github:
https://github.com/berke/wipe/tree/master
The README kind of says it may or may not work.
Need to read that and decide for yourself.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

Post Reply