Java-based security utilities for secure disk operations.
This utility performs DESTRUCTIVE operations that CANNOT be reversed.
- Data overwritten by this tool is PERMANENTLY LOST
- There is NO UNDO functionality
- Verify your target directories multiple times before proceeding
- Designed for secure disposal of storage devices, not regular file deletion
- Always maintain backups of important data elsewhere
Recommended use cases:
- Wiping free space before selling/disposing of hardware
- Securely erasing decommissioned drives
- Preparing media for secure destruction
NOT recommended for:
- Regular file deletion (use
rmor OS file manager instead) - Active filesystems with important data
- System directories (tool blocks these, but be careful)
jsecurity is a disk wiping utility that securely overwrites free disk space with zero-filled files. It uses multiple worker threads to efficiently fill the target directory until the disk is full, making previously deleted data unrecoverable.
- Multi-threaded operation - Configurable worker threads for optimal performance
- Configurable buffer sizes - Adjust memory usage and write performance
- Safety guards - Prevents wiping of critical system directories
- Confirmation prompts - Requires explicit confirmation before destructive operations
- Progress reporting - Real-time feedback on operation progress
- Flexible CLI - Command-line options for automation and customization
- Java 11 or higher - Required to run the application
- Maven 3.6+ - Required to build from source
- Sufficient disk permissions - Write access to target directories
Build the project using Maven:
mvn clean packageThis creates target/jsecurity-1.0.jar with all dependencies.
java -jar target/jsecurity-1.0.jar <directory>The tool will:
- Display a warning about the destructive operation
- Show the target directory and configuration
- Prompt for confirmation (type
yesto proceed) - Start worker threads to fill the disk
- Report completion when disk is full
Options:
-t, --threads <count> Number of worker threads (default: 4)
-b, --buffer-size <bytes> Buffer size in bytes (default: 10485760)
-y, --yes Skip confirmation prompt (for automation)
-h, --help Show help message
Wipe a single directory with defaults:
java -jar target/jsecurity-1.0.jar /tmp/secure-wipeUse 8 threads with 20MB buffer:
java -jar target/jsecurity-1.0.jar -t 8 -b 20971520 /tmp/secure-wipeWipe multiple directories:
java -jar target/jsecurity-1.0.jar /tmp/wipe1 /tmp/wipe2 /tmp/wipe3Skip confirmation (for scripts):
java -jar target/jsecurity-1.0.jar -y /tmp/secure-wipeThe tool automatically blocks operations on critical system directories:
/,/bin,/boot,/dev,/etc,/lib,/lib64/proc,/root,/sbin,/sys,/usr,/var/home,/UsersC:\,C:\Windows,C:\Program Files(Windows)
Attempting to wipe these directories will result in an error.
Unless the -y flag is used, the tool displays:
- Target directories (absolute paths)
- Configuration (threads, buffer size)
- Warning about data loss
- Confirmation prompt requiring
yesresponse
- Validation - Checks target directories are safe and writable
- Configuration - Parses command-line options and builds configuration
- Confirmation - Prompts user to confirm (unless
-yflag used) - Thread Spawning - Creates N worker threads (default: 4)
- File Creation - Each thread creates temp files with pattern
wipe*.disk - Writing - Each thread writes zero-filled buffers until disk is full
- Completion - Reports when all threads have finished
The tool writes until it receives an IOException indicating the disk is full, then attempts a final write to fill any remaining space.
- More threads = faster fill on multi-core systems
- Fewer threads = lower CPU usage
- Recommended: Start with 4, increase if CPU is underutilized
- Maximum: Depends on system capabilities (8-16 is usually sufficient)
- Larger buffers = fewer system calls, potentially faster writes
- Smaller buffers = lower memory usage, more frequent progress updates
- Default: 10MB (10485760 bytes) is a good balance
- Recommended range: 1MB - 100MB depending on available RAM
Run the test suite:
mvn testGenerate coverage report:
mvn jacoco:reportView coverage at target/site/jacoco/index.html
Generate JavaDoc documentation:
mvn javadoc:javadocView documentation at target/site/apidocs/index.html
For detailed usage scenarios and troubleshooting, see USAGE.md.
This project is licensed under the GNU General Public License v3.0 or later.
See LICENSE for the full license text.
This project uses GitHub Actions for automated builds and deployment:
- Automated Versioning - Version automatically increments on push to main (X.Y format)
- Automated Building - Compiles and packages on every push
- Automated Tagging - Creates git tags for each release
- Automated Deployment - Publishes to packagecloud.io (flossware/java/maven2)
View build status: https://github.com/FlossWare/jsecurity/actions
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass (
mvn test) - Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
- This tool does NOT implement secure multi-pass wiping (e.g., DoD 5220.22-M)
- It performs a single-pass zero fill of free space
- For highly sensitive data, consider:
- Multiple passes with different patterns
- Hardware-level secure erase (ATA Secure Erase, NVMe Sanitize)
- Physical destruction of media
For issues, questions, or contributions:
- Open an issue on GitHub
- Review existing issues for similar problems
- Include system details (OS, Java version) in bug reports
Copyright (C) 2017-2026 Scot P. Floess
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See LICENSE for details.