Skip to main content

seclave

The Seclave hardware password manager's USB-slave wire protocol, as a Python library: framing and parsing, serial transports for Linux/macOS/Windows, and a session class with one method per device command.

A Seclave 2 in its "Usb slave" menu exposes a CDC-ACM serial port. The host sends length-framed commands; the device answers with unframed responses, and the user approves each secret read on the device's own screen - that confirmation, not host software, is the security boundary.

Standard library only; no dependencies.

Usage

import seclave

path = seclave.find_port()                 # by USB VID/PID, or pass a path
transport = seclave.open_serial(path)
transport.open()
session = seclave.DeviceSession(transport)

for label in session.list_labels():        # one confirmation on the device
    print(label)

secret = session.get_password("gmail")     # confirmed on the device
try:
    print(secret.text())
finally:
    secret.clear()                         # zero the mmap pages

transport.close()

Secrets are returned as SecretBuffer objects backed by anonymous mmap pages the library zeroes on .clear(); response bytes are parsed in place in an mmap arena that is wiped after every command, so secret bytes never sit in an intermediate Python bytes. Blocking calls raise Cancelled when interrupted with transport.wake(), Disconnected when the port goes away, and DeviceError for a device-reported failure.

seclave.testing is a stub device speaking the protocol over a pseudo-terminal, for tests and development without hardware (python3 -m seclave.testing prints a port path to point any client at). seclave.udev carries the Linux udev rule for the device (ModemManager ignore, user access, /dev/seclave) and installs it; seclave-ctl udev install is the command-line face of it.

Relation to the other Seclave tools

  • seclave-companion is the desktop GUI. It deliberately does not depend on this library - it stays a single self-contained file - but its protocol layer and this library are the same code, held together by the conformance vectors in the seclave-tools repo.
  • seclave-ctl is the command-line client built on this library.
  • A Rust seclave crate implements the same protocol, verified against the same vectors.

License

MIT - see LICENSE.

Seclave is a trademark of Seclave AB. This license grants no trademark rights.

Release files for seclave 0.1.1

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

Source distribution (sdist)

Source distribution for seclave 0.1.1
File Size Uploaded
seclave-0.1.1.tar.gz 24.6 kB Details

Built distribution (wheel)

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

Total release size: 44.6 kB

Release files / seclave-0.1.1.tar.gz

Download URL seclave-0.1.1.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f0447a7c3c23559d8025ff9936ec7a383a0f780b2a87bd878b71cb9667e9b589
BLAKE2b-256 checksum
How to use checksums
416d2e60d09c5cabd853934b656f17afeb7b64a4331204f8d2da252ebbfcafbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / seclave-0.1.1-py3-none-any.whl

Download URL seclave-0.1.1-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ab74df649283a6e6f107d5eb7426f0758159a1c0437e15b354bf3adb8a2f08f
BLAKE2b-256 checksum
How to use checksums
e55929c7cebaacfcbe42e114b4cc600a8b14caadb024ece08c20dbfbc3ac7ffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

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