Skip to content

skdishansachin/shrd

shrd

shrd is a modern, fast, and secure file shredding utility written in Rust. It is designed to be a performant and reliable alternative to traditional tools like GNU shred.

Features

  • Leverages multi-threading to shred multiple files concurrently, making it ideal for large directories.
  • Multiple overwrite passes (default 3, configurable).
  • Varied patterns including random data, fixed patterns (0xFF, 0xAA), and a final zero-out pass.
  • Resetting file timestamps to the Unix epoch before deletion.
  • Multiple randomized renames to obscure original filename and length.
  • Synchronizes data to disk and flushes directory metadata to ensure complete removal.
  • Automatically handles read-only files if the user has permission to modify them.

Installation

To build from source, you need the Rust toolchain installed.

cargo build --release

The binary will be available in target/release/shrd.

Usage

shrd [OPTIONS] <TARGET>

Examples

Shred a single file:

shrd secret.txt

Shred a directory recursively with 5 passes:

shrd -r -p 5 ./private_folder

Shred without confirmation:

shrd -y obsolete_data.db

Options

  • -p, --passes <PASSES>: Number of overwrite passes (default: 3).
  • -r, --recursive: Perform a recursive shredding of directories.
  • -y, --force: Skip confirmation prompt.
  • -j, --jobs <JOBS>: Number of parallel jobs (default is number of CPUs).
  • -h, --help: Print help.
  • -V, --version: Print version.

Limitations

shrd is a powerful tool, but like all shredding utilities, it may be ineffective on:

  • SSDs and NVMe drives due to wear leveling and flash management.
  • Copy-on-Write (COW) filesystems like Btrfs or ZFS.
  • Journaled filesystems when only metadata is journaled.

In these cases, the data may remain on the physical media even after the file is "shredded."

License

MIT

About

Shrd securely overwrites files and directories to prevent recovery

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors

Languages