Skip to content

LinuxCTRL/secure-file-shredder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ” Secure File Shredder

Python License Platform Security

Make your sensitive data PERMANENTLY GONE! πŸ’€πŸ”’

A military-grade file shredding tool that overwrites data multiple times using advanced algorithms, making recovery impossible even with forensic tools.

✨ Features

  • πŸ”₯ Military-Grade Deletion - Multiple overwrite passes using DoD 5220.22-M standard
  • πŸ›‘οΈ Forensic-Proof - Makes data recovery impossible even with advanced tools
  • πŸ“Š Multiple Algorithms - Gutmann (35 passes), DoD (7 passes), Random, Zero-fill
  • 🎯 Selective Shredding - Target specific files, folders, or file types
  • πŸ“ˆ Progress Tracking - Beautiful progress bars and real-time statistics
  • πŸ” Verification - Confirms successful deletion with integrity checks
  • πŸ’Ύ Free Space Wiping - Securely wipe unallocated disk space
  • 🎨 Rich CLI - Colored output with detailed reporting
  • ⚑ High Performance - Multi-threaded processing for large files
  • 🐍 Virtual Environment - Clean, isolated installation
  • πŸ”§ Highly Configurable - Custom patterns, passes, and verification levels

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/LinuxCTRL/secure-file-shredder.git
cd secure-file-shredder

# Install with virtual environment (recommended)
chmod +x install_venv.sh
./install_venv.sh

# Restart terminal or reload shell
source ~/.bashrc

Basic Usage

# Shred a single file (7 DoD passes)
secure-delete shred file.txt

# Shred with maximum security (35 Gutmann passes)
secure-delete shred sensitive_document.pdf --method gutmann

# Shred entire directory recursively
secure-delete shred /path/to/secret_folder --recursive

# Wipe free space on drive
secure-delete --wipe-free-space /home/user

πŸ“‹ Commands

Core Commands

Command Description Example
secure-delete <file> Shred single file secure-delete document.pdf
--recursive Shred directory recursively secure-delete folder/ --recursive
--method <algorithm> Choose shredding method secure-delete file.txt --method gutmann
--passes <number> Custom number of passes secure-delete file.txt --passes 10

Advanced Commands

Command Description Example
--wipe-free-space Wipe unallocated space secure-delete --wipe-free-space /home
--pattern <files> Shred files by pattern secure-delete --pattern "*.tmp,*.log"
--verify Verify deletion success secure-delete file.txt --verify
--benchmark Test shredding speed secure-delete --benchmark

Security Levels

Method Passes Description Use Case
quick 1 Single random overwrite Non-sensitive data
dod 7 DoD 5220.22-M standard Government standard
gutmann 35 Gutmann algorithm Maximum security
random 3 Random data passes General purpose
zero 1 Zero-fill overwrite Basic deletion

πŸ› οΈ Advanced Usage

Shredding Methods

# Quick deletion (1 pass)
secure-delete file.txt --method quick

# DoD standard (7 passes) - DEFAULT
secure-delete file.txt --method dod

# Maximum security (35 passes)
secure-delete file.txt --method gutmann

# Custom number of passes
secure-delete file.txt --passes 15

# Random data overwrite
secure-delete file.txt --method random --passes 5

Recursive Directory Shredding

# Shred entire directory
secure-delete /path/to/directory --recursive

# Shred with confirmation prompts
secure-delete /path/to/directory --recursive --confirm

# Shred but preserve directory structure
secure-delete /path/to/directory --recursive --keep-structure

# Exclude specific file types
secure-delete /path/to/directory --recursive --exclude "*.jpg,*.png"

Pattern-Based Shredding

# Shred all temporary files
secure-delete --pattern "*.tmp" --recursive /home/user

# Shred log files older than 30 days
secure-delete --pattern "*.log" --older-than 30d

# Shred specific file extensions
secure-delete --pattern "*.doc,*.pdf,*.txt" /documents

# Shred files larger than 100MB
secure-delete --pattern "*" --min-size 100MB /downloads

Free Space Wiping

# Wipe free space on entire drive
secure-delete --wipe-free-space /

# Wipe free space with custom passes
secure-delete --wipe-free-space /home --passes 3

# Wipe free space with progress
secure-delete --wipe-free-space /tmp --verbose

# Quick free space wipe
secure-delete --wipe-free-space /var --method quick

Verification & Reporting

# Verify deletion with integrity check
secure-delete file.txt --verify

# Generate detailed report
secure-delete file.txt --report --export pdf

# Benchmark shredding performance
secure-delete --benchmark --size 1GB

# Dry run (preview what will be deleted)
secure-delete /path --recursive --dry-run

πŸ“Š Sample Output

Single File Shredding

πŸ” Secure File Shredder v1.0.0

🎯 Target: sensitive_document.pdf
πŸ“Š Size: 2.5 MB
πŸ›‘οΈ Method: DoD 5220.22-M (7 passes)
πŸ” Verification: Enabled

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Shredding Progress                                                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Pass 1/7: Random Data    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 2/7: Complement     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 3/7: Random Data    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 4/7: DoD Pattern    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 5/7: DoD Pattern    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 6/7: Random Data    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β”‚ Pass 7/7: Verification   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 2.5MB β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βœ… File successfully shredded and deleted!

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Shredding Report                                                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ File: sensitive_document.pdf                                                   β”‚
β”‚ Original Size: 2.5 MB                                                          β”‚
β”‚ Method: DoD 5220.22-M                                                          β”‚
β”‚ Passes Completed: 7/7                                                          β”‚
β”‚ Time Taken: 3.2 seconds                                                        β”‚
β”‚ Speed: 781 KB/s                                                                β”‚
β”‚ Verification: PASSED                                                           β”‚
β”‚ Recovery Probability: 0.00% (Forensically Secure)                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›‘οΈ Data is now PERMANENTLY GONE and cannot be recovered!

Directory Shredding

πŸ” Secure File Shredder - Directory Mode

πŸ“ Target: /home/user/sensitive_data/
πŸ” Scanning directory...

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Files Found                                                                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Total Files: 47                                                                β”‚
β”‚ Total Size: 156.7 MB                                                           β”‚
β”‚ File Types: .pdf (15), .doc (12), .txt (8), .jpg (7), .xlsx (5)              β”‚
β”‚ Estimated Time: 2m 34s                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›‘οΈ Method: DoD 5220.22-M (7 passes per file)

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 47/47 files | 156.7MB processed

βœ… Directory shredding completed!

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Summary Report                                                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Files Processed: 47/47                                                         β”‚
β”‚ Data Destroyed: 156.7 MB                                                       β”‚
β”‚ Total Passes: 329 (47 files Γ— 7 passes)                                       β”‚
β”‚ Time Taken: 2m 31s                                                             β”‚
β”‚ Average Speed: 1.04 MB/s                                                       β”‚
β”‚ Verification: ALL PASSED                                                       β”‚
β”‚ Security Level: MAXIMUM                                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🚨 WARNING: All data has been PERMANENTLY DESTROYED and cannot be recovered!

Free Space Wiping

πŸ” Free Space Wiping Mode

πŸ’Ύ Target Drive: /home (ext4)
πŸ“Š Free Space: 45.2 GB
πŸ›‘οΈ Method: Random Data (3 passes)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Free Space Analysis                                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Total Capacity: 500 GB                                                         β”‚
β”‚ Used Space: 454.8 GB                                                           β”‚
β”‚ Free Space: 45.2 GB                                                            β”‚
β”‚ Recoverable Data: ~12.3 GB (estimated)                                         β”‚
β”‚ Wipe Strategy: Sequential block overwrite                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Wiping free space...

Pass 1/3: Random Pattern  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 45.2GB
Pass 2/3: Random Pattern  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 45.2GB
Pass 3/3: Zero Fill       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% | 45.2GB

βœ… Free space wiping completed!

πŸ›‘οΈ Previously deleted files are now unrecoverable!
Time taken: 18m 42s | Speed: 4.1 MB/s

πŸ”’ Security Algorithms

DoD 5220.22-M (Default)

  • 7 passes following US Department of Defense standard
  • Pass 1: Random data
  • Pass 2: Complement of pass 1
  • Pass 3: Random data
  • Pass 4: DoD pattern (0x96)
  • Pass 5: DoD pattern (0x69)
  • Pass 6: Random data
  • Pass 7: Verification pass

Gutmann Algorithm (Maximum Security)

  • 35 passes designed by Peter Gutmann
  • Covers all magnetic encoding methods
  • Includes random and specific patterns
  • Designed for maximum paranoia
  • Overkill for modern drives but ultra-secure

Custom Patterns

# Define custom overwrite patterns
secure-delete file.txt --custom-pattern "0xFF,0x00,random,0xAA"

# Use specific byte patterns
secure-delete file.txt --pattern-file patterns.txt

# Combine multiple methods
secure-delete file.txt --method dod --extra-passes 5

βš™οΈ Configuration

Configuration is stored at ~/.config/secure-shredder/config.json:

{
  "default_method": "dod",
  "default_passes": 7,
  "verification_enabled": true,
  "progress_bar": true,
  "colored_output": true,
  "confirmation_prompts": true,
  "performance": {
    "buffer_size": "1MB",
    "max_threads": 4,
    "sync_after_pass": true
  },
  "security": {
    "secure_random": true,
    "clear_memory": true,
    "disable_swap": false
  },
  "logging": {
    "enabled": true,
    "log_level": "INFO",
    "log_path": "~/.local/share/secure-shredder/logs/"
  }
}

πŸ”§ Requirements

  • Python 3.7+
  • Virtual environment (automatically created)
  • Sufficient disk space for temporary operations
  • Administrative privileges (for some operations)

Dependencies

click>=8.0.0           # CLI interface
rich>=12.0.0           # Beautiful terminal output
cryptography>=3.4.0    # Secure random generation
psutil>=5.8.0          # System information
tqdm>=4.62.0           # Progress bars
colorama>=0.4.4        # Colored output

πŸ›‘οΈ Security Features

Cryptographically Secure Random

  • Uses OS entropy sources for random data generation
  • CSPRNG (Cryptographically Secure Pseudo-Random Number Generator)
  • No predictable patterns in overwrite data

Memory Security

  • Secure memory clearing after operations
  • No sensitive data left in RAM
  • Optional swap file disabling

Verification

  • Read-back verification of overwritten data
  • Checksum validation of destruction
  • Forensic-level confirmation

πŸš€ Performance

Optimization Features

  • Multi-threaded processing for large files
  • Optimized I/O operations with proper buffering
  • Memory-mapped files for better performance
  • Parallel directory processing
  • SSD-aware operations (TRIM support)

Benchmarks

  • Single file (100MB): ~15-30 seconds (DoD method)
  • Directory (1GB, 100 files): ~3-5 minutes
  • Free space (10GB): ~8-15 minutes
  • Performance varies by storage type and system

πŸ› οΈ Development

Manual Installation

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run directly
python3 secure_shredder.py --help

Project Structure

secure-file-shredder/
β”œβ”€β”€ secure_shredder.py        # Main application
β”œβ”€β”€ algorithms/               # Shredding algorithms
β”‚   β”œβ”€β”€ dod.py               # DoD 5220.22-M
β”‚   β”œβ”€β”€ gutmann.py           # Gutmann 35-pass
β”‚   └── custom.py            # Custom patterns
β”œβ”€β”€ install_venv.sh          # Virtual environment installer
β”œβ”€β”€ run.sh                   # Runner script
β”œβ”€β”€ requirements.txt         # Dependencies
β”œβ”€β”€ README.md               # This file
β”œβ”€β”€ LICENSE                 # MIT License
└── tests/                  # Test suite
    β”œβ”€β”€ test_shredding.py
    β”œβ”€β”€ test_algorithms.py
    └── test_verification.py

⚠️ Important Warnings

🚨 DATA DESTRUCTION WARNING

  • THIS TOOL PERMANENTLY DESTROYS DATA
  • DELETED FILES CANNOT BE RECOVERED
  • USE WITH EXTREME CAUTION
  • ALWAYS BACKUP IMPORTANT DATA FIRST

πŸ”’ Legal Considerations

  • Ensure you have permission to delete the data
  • Some jurisdictions require data retention
  • Corporate environments may have specific policies
  • Use responsibly and legally

πŸ’Ύ Technical Limitations

  • SSD wear leveling may affect effectiveness
  • Modern drives use internal remapping
  • TRIM commands may be more effective for SSDs
  • Physical destruction is ultimate security

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


⭐ Star this repo if it helps you secure your data!

Made with ❀️ by LinuxCTRL - Controlling the world through better developer tools! 🌍πŸ’ͺ

Part of the LinuxCTRL Developer Toolkit - Building tools that developers actually want to use.

⚠️ USE RESPONSIBLY - DATA DESTRUCTION IS PERMANENT! ⚠️

About

A military-grade file shredding tool that overwrites data multiple times using advanced algorithms, making recovery impossible even with forensic tools.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors