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.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 seclave 0.1.2
File Size Uploaded
seclave-0.1.2.tar.gz 24.6 kB Details

Built distribution (wheel)

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

Total release size: 44.6 kB

Release files / seclave-0.1.2.tar.gz

Download URL seclave-0.1.2.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
238be70c287f29eb827c3b14bde8911dbbec62cd8603f089992464598ee9e567
BLAKE2b-256 checksum
How to use checksums
53e25dfb9205042ca39a190cfa80313e4dc226dc5c3f66f5de8dd2a8c9353273
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.2-py3-none-any.whl

Download URL seclave-0.1.2-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
358d456ff8eedb8e434dd49578c7cfddcfcceeb61eb6c95305939fcc713ac927
BLAKE2b-256 checksum
How to use checksums
abf2ff2d2988773ba1c880a49da944ef08779978436b234c14f8a47e61db1d73
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

This release

0.1.2 This release

2 release files

0.1.1

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