So far as we are going through the course we interacted with the file system quite often.
We also learned how to download and upload files how to share files securely with friends and contacts
how to remove metadata that can be used to anonymize us or get information about us.
So before moving to the next section I think there is still one missing piece which is how to properly
delete files and wipe storage media.
Now in general and operating systems when you right click a file and deleted or even if you shift deleted
and empty your recycle bin or your trash the file doesn't actually get deleted.
What happens is the operating system marks the file or marks this piece that the file was occupying
on the storage device as available so the data of that file will still exist on your storage device.
Until that space is overwritten with other data.
That's why we see so many tools that are very easy to use that you can use to recover deleted files.
Now these are very simple tools that you can download from the Internet for free so you can only imagine
what a resourceful adversary can do so because deleting a file doesn't actually delete the content of
it or its data unless it's overwritten with other data.
There are tools that randomly fill up that piece of that file with random data so that it's more difficult
to recover that file.
Now tells comes with such tools pre installed as you'd expect.
So if we go through our file manager and go through the file that we want to delete.
So in my case it's in files and it's this image right here.
Now I can right click the image and just click on move to thrush which will literally just move a toothbrush
similar to any other operating system.
And then I'd have to go to the trash right click and empty.
And like I said this will still not delete the content of this image or the data of this image from
my storage.
The better option to go to if you want to security remove this file is to click on wipe right here.
Now if you click on that and expand the options in here you'll see that it will ask you for the number
of passes of random data that will be executed to override the location that contains the data of this
image.
So by default this is set to two which should be good enough for most hard disks.
You can set it to 38 for all ones or one which is not very secure which will only protect you from the
very simple software that you can download on the Internet.
Now this method will work on hard drives but it won't work on U.S. beef steaks or solid state drives.
Now if you don't know the difference between hard drives and solid state drives then I highly recommend
you go and do some reading on that.
I will include things in the resources of this lecture.
But basically the way that solid state drives work they don't have sectors.
They use cells in order to store your data.
And even if we use a tool similar to this tool right here in order to override a specific location of
this solid storage device the logic inside this storage device will probably overwrite the request that
we make in order to increase the life of the device.
Therefore you might use this click on wipe and think that it works but it might actually not work as
you would expect it.
So you can only properly rely on this method if you're using a hard drive and not a solid state drive
or a US b device.
Now that's for removing one specific file.
Well what if we wanted to clear all of the free space or all of the available space on the system.
Now this is only relevant if you're using persistence obviously and you might want to do this because
you've deleted a number of files insecure lives so by literally moving them to trash and emptying the
trash and then the contents of these files like I said will still be recoverable from your storage device.
Therefore what you want to do is you want to right click any empty space in your file manager click
on WIP available disk space and you'll get a very similar window to the one that we just got with the
same options.
And once you set the options you click on wipe and still clean and that'll securely clean the available
disk space so it won't delete the files that you have.
It will only clean the available disk space filling it with random data to make sure that it can't be
used to recover the files that you deleted.
So it will only clean the files that you deleted.
It won't affect anything that you already have on your storage device that you did not delete yourself.
Now this is great.
But again it won't work as expected when it comes to solid state devices anti US devices for the same
reason that I mentioned earlier.
Therefore if you're using a solid state device or a USB device and you want to securely delete all of
the data that you have on it then you have two options.
First option is physically destroy that device so you can burn it put it in a microwave do whatever
you want really.
Or the other option is to securely format the device and wipe it and I'm going to show you how to do
that in the next lecture.