Skip to main content

Description

This is a python library for securely deleting (shredding) files and directories. The code calls into rozbb's rust-shred library using Py03 and maturin. I merely modernized the code (the code was written >10 years ago) and made it callable from Python

Why Shredding?

Computers typically "delete" files by removing the file system reference to the file. This means disk recovery tools can possibly find and recover the file.

So why do we overwrite multiple times?

Each time a transistor is toggled, slight remenants of the previous states remain. This means parts of files can still be recovered using state of the art tools.

Using multiple passes effectively burns out all traces of the old state, the more passes, the better.

Warning

There are cases where data is duplicated which this deletion method doesn't detect and handle. Examples are the file system journal and overprovisioned SSD's.

I suggest reading NIST Special Publication 800 NIST SP 800-88r2 section '3.1.1. Clear Sanitization Method' for more information.

If privacy is a true goal of yours, You'd be far better off switching to an operating system like TAILS.

Example Usage

from test_stuff import shred
from pathlib import Path


f = Path("./secrets")
f.write_text("My password is foo123!")
shred(
    path: f, # Which file are we shredding
    n_passes: 10, # How many times is this file overwritten with random bytes
    remove: True, # Is this file deleted after shredding
    size: None, # How many bytes we want to shred. If None, the entire file is shredded.
    exact: True, # If true, delete exactly size bytes, otherwise delete size rounded up to the next page table boundary
    zero: True, # Do we do an additional pass to zero out the file.
    verbose: False, # Do we print debug information
)

Metadata

Release files for file_shredder 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file_shredder 0.1.2
File Size Uploaded Provenance Actions
file_shredder-0.1.2.tar.gz 15.4 kB Without provenance Details for file_shredder-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for file_shredder 0.1.2
File Interpreter ABI Platform Actions
file_shredder-0.1.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for file_shredder-0.1.2-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 252.5 kB

Release files / file_shredder-0.1.2.tar.gz

Download URL file_shredder-0.1.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9411f405154422b4d0e96cb32e29430ee983f7fda0cd70a99b48454dd33d7a60
BLAKE2b-256 checksum
How to use checksums
08e546da6b140281e0c5e7ab501ab477400d9951b18fc86f7cc74b9521b508ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / file_shredder-0.1.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL file_shredder-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Size 237.1 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
deb013823bc08d513d73c9c28ce77812e6e7d3d04f1e14329b13158fdf399e6c
BLAKE2b-256 checksum
How to use checksums
80cd3e39850e73dc5ed4d11c7a93fbfede5eae63e7d6b38656ebdea1c9a823c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for file_shredder 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page