Linux-first Rust CLI to unlock Samsung Portable SSD T3 drives.
# install dependencies (Debian/Ubuntu)
sudo apt-get install -y build-essential pkg-config libusb-1.0-0-dev
# build
cargo build --release
# show status (defaults to Samsung VID=04e8, PID=61f4 — override if needed)
./target/release/t3unlock status
# simulate unlock (no USB I/O)
./target/release/t3unlock unlock --dry-run
# try unlock (will prompt for password)
./target/release/t3unlock unlockInstall the provided rule, then reload udev:
sudo install -D -m 0644 contrib/udev/99-t3unlock.rules /etc/udev/rules.d/99-t3unlock.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
# replug the deviceOn some distros you may need to add your user to plugdev (or equivalent).
status— detect device and (placeholder) lock state.unlock— unlock flow (prompts for password if--passwordnot given). Use--dry-runto simulate.doctor— print common Linux diagnostics.gen-completions <bash|zsh|fish>— emits shell completions to stdout.gen-man <OUTDIR>— writest3unlock.1manpage to the directory.
- Override USB IDs via env:
T3UNLOCK_VID=04e8 T3UNLOCK_PID=61f3
- Adjust timeouts with
--timeout-msor envT3UNLOCK_TIMEOUT_MS(coming soon).
- Passing
--passwordon the command line may leak into shell history or process listings. Prefer interactive prompt. - Password buffers are zeroized after use (
zeroize). Secrets are never logged.
cargo fmt --all
cargo clippy --all-targets -- -D warnings
cargo test# man page
./target/release/t3unlock gen-man ./target
# completions (bash)
./target/release/t3unlock gen-completions bash > contrib/completions/t3unlock.bashSee .github/workflows/ci.yml for lint/build/test and artifact upload (skeleton).
This tool talks to the Samsung Portable SSD T3 over bulk endpoints (not control transfers):
- Interface:
0 - Endpoints:
- OUT (host → device):
0x02 - IN (device → host):
0x81
- OUT (host → device):
- Sequence:
- OUT: 31-byte
unlockpacket - OUT: 512-byte
passwordpacket (ASCII/UTF-8, NUL-terminated/zero-padded) - IN: 512-byte
return→ byte9 == 0x02means failure - OUT: 31-byte
relinkpacket - IN: 512-byte
return→ byte9 == 0x02means failure
- OUT: 31-byte
- VID:
0x04e8(Samsung) - PID (T3 locked):
0x61f4
Override with CLI (--vid/--pid) or env (T3UNLOCK_VID/T3UNLOCK_PID).
Install the udev rule and replug the drive:
sudo install -D -m 0644 contrib/udev/99-t3unlock.rules /etc/udev/rules.d/99-t3unlock.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
# replug the drive; ensure you're in the plugdev group-
lsusbshows the T3. -
t3unlock statusprintsPresent: true. - Install udev rule; reconnection works without sudo.
-
t3unlock unlock --dry-runlogs the intended sequence. - With correct constants in
usb/proto.rs,unlocksucceeds with the right password.