A Python-based command-line utility for secure deletion of files and directories. This tool ensures that deleted data cannot be recovered by overwriting it with multiple passes of random data followed by zero-padding.
- Secure Random Data Overwriting: Uses a strong secure random number generator to overwrite files and directories with random data.
- Zero Data Pass: Ensures data is irrecoverable by applying a final pass of zeros.
- Batch File & Directory Deletion: Securely deletes multiple files and directories in a single command.
- Subdirectory Handling: Recursively deletes all contents within directories, including subdirectories.
- Hard Link Detection: Warns if a file has multiple hard links, as the data may still be recoverable elsewhere.
- Symbolic Link Protection: Prevents accidental deletion of symbolic links.
- Free Space Wiping: Option to wipe all free space on a specified drive to prevent data recovery.
- Python 3.6 or later
- Linux operating system
-
Clone the repository:
git clone https://github.com/Bolo101/fileRemove.git cd fileRemove/code ``
-
Ensure the script is executable:
chmod +x main.py
-
Create a symbolic link to use the tool as a system-wide command (
fr):sudo ln -s $(pwd)/main.py /usr/local/bin/frYou can now use the tool with the
frcommand.
To securely delete files:
fr file1.txt file2.txtTo securely delete a directory and its contents:
fr folder_nameYou can mix files and directories in the same command:
fr file1.txt folder_name file2.logBy default, the tool performs 3 passes of overwriting. To specify a custom number of passes:
fr -p 7 secret.txtThis will overwrite secret.txt 5 times before deleting it.
To securely wipe all free space on a drive (e.g., / for the root filesystem):
fr --wipe /Use the --help flag to display usage information:
fr --helpproject/
├── README.md # Documentation for the project
├── code/
├── main.py # Entry point for the CLI tool
├── secure_delete.py # Logic for secure deletion of files and directories
├── random_generator.py # Secure random number generator implementation
├── LICENSE # LICENSEThis project is licensed under the Creative Commons 4 License - see the LICENSE file for details.