Skip to main content

safedatatransfer

Empty a USB stick into an encrypted vault, verify it, wipe it.
Send files between two Windows PCs with no router, no cloud, no account.

PyPI Release Tests Python Windows License: MIT

pipx install safedatatransfer

sdt usb evacuate E:       # USB stick -> encrypted vault -> verified -> stick wiped
sdt drop receive          # PC 1: shows a code like 482-913
sdt drop send report.pdf  # PC 2: type the code, done

sdt UI: a USB stick is copied into an encrypted vault, the vault is unlocked, a file is queued for local drop
Run sdt for the full-screen UI. Shown with a demo stick and sample files.

About

sdt is one small command-line tool (with a keyboard-driven UI) that does two things:

  • 🔐 USB vault: copies everything off a USB stick into an encrypted vault (AES-256-GCM, scrypt), checks every file, then wipes the stick.
  • 📡 Local drop: AirDrop-style transfer between two Windows PCs over Wi-Fi Direct, protected by a 6-digit one-time code and end-to-end encryption.

What makes it different:

  • ✅ Nothing is wiped until every file is verified. It decrypts the vault again, reads it straight from the disk past the Windows cache, and re-reads the stick before wiping.
  • 🧷 Hard to wipe the wrong thing. It refuses the system disk, a swapped stick, a stick that holds your vault, and links or junctions that point elsewhere.
  • 🙈 Nothing in plaintext. File contents, names and folder structure are all encrypted.
  • 🔥 No firewall changes, no admin rights, no open ports while waiting for a sender.
  • 📦 Installs nothing system-wide. Delete the folder and it's gone.

Install

No Python? Use the exe: download sdt.exe from the latest release, check it against sdt.exe.sha256, and run it. It's built by GitHub Actions from the tagged source. It isn't code-signed yet, so Windows SmartScreen may warn the first time (More info → Run anyway).

Get-FileHash .\sdt.exe     # compare with sdt.exe.sha256
.\sdt.exe

The other ways need Python 3.11+ (winget install Python.Python.3.13).

With pipx (recommended: it gets its own private environment):

pipx install safedatatransfer
sdt

Without installing: download the latest release source zip, unpack it, and run:

.\sdt

On the first run, sdt.cmd creates a private .venv (1–2 minutes), and installs the exact pinned versions from constraints.txt there, prebuilt wheels only. It runs Python in isolated mode, so Python files on an untrusted stick are never imported.

Install a downloaded wheel by hand

Each release lists the SHA-256 of its files.

$whl = (Get-Item .\safedatatransfer-*-py3-none-any.whl).FullName
Get-FileHash $whl     # compare with the release notes
py -m venv $HOME\sdt-env
& $HOME\sdt-env\Scripts\python -I -m pip install --only-binary=:all: $whl
& $HOME\sdt-env\Scripts\sdt --version

Usage

Empty a USB stick

sdt usb list                  # find your stick, e.g. E:
sdt usb evacuate E: --dry-run # show what would happen, write nothing
sdt usb evacuate E:           # encrypt -> ~/Downloads/usb-vault/..., verify, wipe
More USB and vault commands
sdt usb info E:                         # every detail about the stick
sdt usb evacuate E: --dest F:\vault     # put the vault on your other USB stick
sdt usb copy E:                         # encrypted copy only, no wipe
sdt usb wipe E: --method quick          # wipe only
sdt usb wipe E: --method fill           # wipe + fill free space (only when you ask for it)

sdt vault list  "C:\...\usb-vault\vault_20261101-120000"           # see what's inside
sdt vault open  "C:\...\usb-vault\vault_20261101-120000"           # decrypt back to normal files
sdt vault shred "C:\...\usb-vault\vault_20261101-120000_opened"    # remove the decrypted copy

Send files to another PC

sdt drop receive          # on the receiving PC: shows a name like sdt-4821 and a code like 482-913
sdt drop send file.pdf    # on the sending PC: finds it, asks for the code

Both PCs only need Wi-Fi switched on; they don't need to be on the same network. You can also do this in the UI: tab 4, then g to receive, or f and s to send. See docs/local-drop.md for the security design and first-run notes.

Interactive UI

Run sdt with no arguments. You can watch sticks appear when you plug them in, browse their files, unlock vaults, send files to another PC, and follow progress live.

Key Action
1 2 3 4 Drives / Vaults / Activity / Drop tab
c / e / w encrypted copy / evacuate (copy → verify → wipe) / wipe
u / o / l / p unlock a vault / open (decrypt) it / lock / add a vault from elsewhere
h SHA-256 of the selected file
f / x / s Drop: add a file or folder / clear the list / send
g / k Drop: receive (shows a name and a code) / stop
d DRY-RUN mode: simulate everything, write nothing
a / r / b show all drives / refresh / hide the banner
? / q help / quit

The UI locks unlocked vaults after 10 minutes without input.

How evacuate works

  1. Password: you type it twice. It must be at least 12 characters and not a simple pattern. A very common word (like password) is only allowed in passwords of 20 characters or more. A few random words work well.
  2. Encrypt: it checks for free space, then encrypts every file (and hidden NTFS data streams) into the vault.
  3. Verify: it decrypts every file again, read past the Windows cache, and compares SHA-256 with the original. If any file fails, nothing is wiped.
  4. Same stick? It checks volume serial, size, file system, hardware serial and disk number.
  5. Prove the password: you type it once more (3 tries), so you can't lock yourself out.
  6. Confirm: you type WIPE E:. It shows how many files and how much data will be destroyed, then checks the stick and the vault files once more.
  7. Re-read: it reads the whole stick again and compares every SHA-256 with the vault. Anything new, changed or unreadable stops the wipe.
  8. Wipe:
    • quick (default): each file is overwritten with random data, renamed, and deleted. On FAT32/exFAT this includes the slack space at the end of the file's last cluster. Old directory entries that still hold the original file names are overwritten too. Free space is not touched.
    • fill (only with --method fill): everything quick does, plus all free space is filled with random data and then freed again. This also erases traces of files deleted earlier.
  9. Check: it confirms the stick is really empty and reports anything left.
All safety rules
  • Never touches the system drive, or anything on the same physical disk as Windows.
  • Only removable drives, unless you pass --allow-fixed.
  • Refuses if the vault would be on the drive being wiped. This is checked by volume serial, so mount folders and subst drives are caught too.
  • Links and junctions are never followed. A junction on the stick that points at e.g. C:\Users is neither copied nor wiped through; only the link itself is removed.
  • Only wipes when the stick holds exactly the files that were verified. A file that appeared or changed after the copy stops the wipe, even if its size and timestamp stayed the same.
  • A folder that can't be read makes the copy fail, so nothing unread is ever wiped.
  • Refuses a stick that sdt itself (or its Python) runs from.
  • Refuses a stick that holds an sdt vault (probably your backup; --allow-vault overrides).
  • Refuses vault destinations in a Temp folder or a Recycle Bin, which Windows may empty.
  • While wiping, it re-checks every few seconds that it's still the same stick and stops if not. Right before each file, it checks the file really is inside the stick.
  • A file with a second name (NTFS hard link) only loses that name; its data is overwritten when its last name is wiped.
  • $RECYCLE.BIN is copied and wiped like any other folder (deleted files are often the secret ones). Only System Volume Information is skipped.
  • The default vault name (vault_<date>) doesn't contain the stick's label; the label is stored inside the encrypted manifest.
Vault format and encryption
  • Key: scrypt (n=2¹⁸, about 256 MB and 0.5 s per guess) turns the password into a key. Older vaults keep their own setting.
  • Per-file keys: HKDF derives a separate key for each file.
  • Encryption: AES-256-GCM in 1 MiB chunks, so any change, truncation or reordering is detected.
  • Passwords are Unicode-normalized, so the same password typed on another keyboard still works.
  • If you forget the password, the data is gone.
File Contents
vault.json salt and KDF settings (not secret)
manifest.enc + manifest.backup.enc encrypted file list, stored twice; if one is damaged, the other is used and sdt vault list warns you
blobs/<random>.enc one per file or data stream

Blob sizes still roughly reveal file sizes. An interrupted copy shows up as INCOMPLETE in sdt vault info.

sdt vault open writes plaintext, so it:

  • refuses OneDrive, Dropbox and Google Drive folders unless you pass --allow-cloud;
  • only writes into an empty or new folder;
  • marks the files "do not index" for Windows Search;
  • overwrites partially written files before deleting them;
  • leaves a .sdt-opened marker. sdt vault shred refuses any folder without it, and only destroys the files that open wrote. (A file of your own with that name at the top of the vault is restored as .sdt-opened (from the vault).)
Local drop security
  • Code: a 6-digit code checked with SPAKE2. An attacker gets one guess per session, and recorded traffic doesn't help.
  • Encryption: everything is end-to-end encrypted with AES-256-GCM, including file names and sizes.
  • No open ports while waiting. After the link is up, only the PC at the other end can connect, and only once.
  • Random name: the receiver advertises a random name (sdt-4821), not your PC's name.
  • Approval: you see the file list and must accept before anything is saved (type y, or click Accept in the UI, where Decline is preselected).
  • File names are sanitized: no .., no reserved names, no invisible right-to-left tricks.
  • Received files get the "Mark of the Web", like browser downloads.
  • Pairing: Wi-Fi Direct pairings made for a transfer are removed afterwards.

Full details: docs/local-drop.md.

Limitation of wiping

USB flash drives move data around internally (wear levelling) and keep spare blocks that Windows can't reach. No software overwrite can guarantee that every old copy is gone. For really secret data:

  • keep the data encrypted on the stick too (BitLocker To Go or VeraCrypt), so wiping it means the key is gone, and/or
  • physically destroy the stick after evacuating it.

Status

The USB vault is tested on real sticks and subst drives. Local drop's protocol is covered by automated tests. A real PC-to-PC Wi-Fi Direct transfer still needs testing with two PCs. Feedback and issues are welcome. Found a security problem? Please report it privately, see SECURITY.md.

Project layout and tests
Folder Contents
src/safedatatransfer/usb_vault/ copy, verify, vault, wipe
src/safedatatransfer/local_drop/ protocol, Wi-Fi Direct and LAN links
src/safedatatransfer/common/ encryption, hashing, drive detection
src/safedatatransfer/tui/ interactive UI
.\.venv\Scripts\python -m unittest discover -s tests -v

License

MIT. Use at your own risk, and read Limitation of wiping before trusting any wipe with secret data.

Metadata

Release files for safedatatransfer 0.1.7

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

Source distribution (sdist)

Source distribution for safedatatransfer 0.1.7
File Size Uploaded Provenance Actions
safedatatransfer-0.1.7.tar.gz 105.3 kB With provenance Details for safedatatransfer-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for safedatatransfer 0.1.7
File Interpreter ABI Platform Actions
safedatatransfer-0.1.7-py3-none-any.whl Python 3 none any Details for safedatatransfer-0.1.7-py3-none-any.whl

Total release size: 189.1 kB

Release files / safedatatransfer-0.1.7.tar.gz

Download URL safedatatransfer-0.1.7.tar.gz
Size 105.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2f434ce06730c7d48979c7ff0edb6ac401d94c787137856d2b4f4699b5a6b0fc
BLAKE2b-256 checksum
How to use checksums
583dcd056b2554fabbb86e22c006fb92537988dfda9b9d5409d9fce3c72a80cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / safedatatransfer-0.1.7-py3-none-any.whl

Download URL safedatatransfer-0.1.7-py3-none-any.whl
Size 83.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a61b47480d667be7ba3f91cb3810492185591f42e1ad6a8d8203356900b4c22
BLAKE2b-256 checksum
How to use checksums
09c320829b115ac99c0ca9abdc73e7118fe9cb0d7bff161a77b0e6ef5efee46e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for safedatatransfer 0.1.7

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for safedatatransfer-0.1.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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