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.
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
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
You need Python 3.10+ (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.
Get-FileHash .\safedatatransfer-0.1.0-py3-none-any.whl # compare with the release notes
py -m venv $HOME\sdt-env
& $HOME\sdt-env\Scripts\python -I -m pip install --only-binary=:all: .\safedatatransfer-0.1.0-py3-none-any.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. 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, and follow progress live.
| Key | Action |
|---|---|
1 2 3 |
Drives / Vaults / Activity 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 |
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
- Password: you type it twice. It must be at least 12 characters, with no very common word and no simple pattern. A few random words work well.
- Encrypt: it checks for free space, then encrypts every file (and hidden NTFS data streams) into the vault.
- 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.
- Same stick? It checks volume serial, size, file system, hardware serial and disk number.
- Prove the password: you type it once more (3 tries), so you can't lock yourself out.
- 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. - Re-read: it reads the whole stick again and compares every SHA-256 with the vault. Anything new, changed or unreadable stops the wipe.
- 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): everythingquickdoes, plus all free space is filled with random data and then freed again. This also erases traces of files deleted earlier.
- 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
removabledrives, 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
substdrives are caught too. - Links and junctions are never followed. A junction on the stick that points at e.g.
C:\Usersis 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-vaultoverrides). - 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.BINis copied and wiped like any other folder (deleted files are often the secret ones). OnlySystem Volume Informationis 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-openedmarker.sdt vault shredrefuses any folder without it, and only destroys the files thatopenwrote.
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 type
ybefore anything is saved. - 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.
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| safedatatransfer-0.1.1.tar.gz | 81.4 kB | With provenance | Details for safedatatransfer-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| safedatatransfer-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for safedatatransfer-0.1.1-py3-none-any.whl |
Total release size: 155.9 kB
Release files / safedatatransfer-0.1.1.tar.gz
| Download URL | safedatatransfer-0.1.1.tar.gz |
|---|---|
| Size | 81.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af5cefbd1e82a49dbea3a57387d9b2f6ed1dfe7e2892d2b57dea1b09be4a5170
|
|
BLAKE2b-256 checksum How to use checksums |
18a018b81902e73d095aed0413425223c45c4a41b5df941b64e49b7248b9caf3
|
| 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 8, 2026.
Transparency logRelease files / safedatatransfer-0.1.1-py3-none-any.whl
| Download URL | safedatatransfer-0.1.1-py3-none-any.whl |
|---|---|
| Size | 74.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d250fc8099f7e1988acf1898cbf6ba9aa3bdd777d320fd7d894c6d9a6dbb26e9
|
|
BLAKE2b-256 checksum How to use checksums |
ea4d192b559ec0c8f3a06cb3dcf959b7273f5e4e2a96b7e96fed4b0dbdfa9b3b
|
| 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 8, 2026.
Transparency logSecurity for safedatatransfer 0.1.1
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.
Attestation for safedatatransfer-0.1.1.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 8, 2026.
Transparency logA 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.