Skip to main content

Soft FIDO2 Authenticator

A software-based FIDO2/WebAuthn passkey authenticator implemented in python. This project lets you use passwordless authentication (passkeys) on websites and applications without needing a physical USB security key.

This software implements the W3C WebAuthn specification and CTAP2 protocol, allowing your Linux system to act as a passkey authenticator. However the Attestation generated by this module is typically not trusted by anyone!

Originally this code base was used as a test harness for a FIDO2 Relying Party implementation, however it has grown to support a large number of use cases. The authenticator is capable of generating all attestation formats, including TPM, Anndroid Keystore / SafetyNet, and even compound attestation statements.

Use Cases

  • Testing and Development: Test FIDO2/WebAuthn implementations without physical hardware. Supports various attestation formats for compatibility testing
  • Platform (OS) Authenticator: Use passkeys for authentication on Linux systems/applications which support USB FIDO2/passkey authenticators.

Note: This is experimental software. Use at your own risk.

Quick Start

Installation

Install via pip:

pip3 install soft_fido2

Core python dependencies:

  • asn1 >= 2.2.0
  • cryptography >= 47.0.0
  • cbor2 >= 4.1.2
  • PyJWT >= 0.6.1

Soft dependency targets

# jeepney for dbus interfact to biometric device
pip3 install soft_fido2[bio]
# tpm2-pytss bindings
pip3 install soft_fido2[tpm]
# QT6 GUI
pip3 install soft_fido2[ux]
# All of the above
pip3 install soft_fido2[full]
# Above + Development build tools
pip3 install soft_fido2[dev]

System Dependencies

For some of the GUI features, you need to install additional system packages. The following packages are required for full functionality:

  • Python: 3.10 or higher
  • OpenSSL: 3.2+ with ML-DSA support (for post-quantum cryptography support)
  • tpm2-tss-devel: TPM2 development headers (for TPM2 support)
  • tpm2-pytss: TPM2 Python bindings (system package recommended)
  • dbus-devel: D-Bus development headers (for D-Bus notifications)
  • dbus-glib-devel: GLib development headers (for D-Bus support)
  • qt6: Qt6 development headers (for Qt6 GUI bindings)

Note on ML-DSA Support: Post-quantum cryptography (ML-DSA) requires:

  • Python cryptography library v47.0.0 or higher
  • OpenSSL 3.2+ compiled with ML-DSA support enabled
  • If ML-DSA is not available, the authenticator will still work with traditional algorithms (RSA, ECDSA, Ed25519)

Module Usage

This module can be used to test WebAuthn Attestation and Assertion ceremonies. For information and examples on how to act as the client or authenticator, see the MODULE documentation.

A simple example of using this module to generate a self-signed attestation with an ES256 key:

import soft_fido2, requests
attestation_options = requests.get("https://my.relying.party/attestation/options").json()
authenticator = soft_fido2.Fido2Authenticator()
attestation = authenticator.credential_create(attestation_options)
registration = requests.post("https://my.relying.party/attestation/result", json=attestation).json()
# Save the key
f = open("attestation.key", 'wb'); f.write(authenticator.kp.get_private_bytes()); f.close()

And to generate a self-signed assertion with the same key:

import soft_fido2, requests
# Read the key
f = open("attestation.key", 'rb'); key = f.read(); f.close()
authenticator = soft_fido2.Fido2Authenticator(keyPair=soft_fido2.KeyPair.load_key_pair(key))
assertion_options = requests.get("https://my.relying.party/assertion/options").json()
assertion = authenticator.credential_request(assertion_options)
assertion_result = requests.post("https://my.relying.party/assertion/result", json=assertion).json()

System Authenticator

This module can be run as main to provide a system CTAP2 authenticator service. This allows the module to integrate with systemd via the UHID kernel module. For information on how to set up this python module as a system authenticator, see the PASSKEY documentation.

Alternatively, you can try install the .deb or .rpm system package to install the module and its required dependencies. Note this will add your $USER to the uhid group, which will require you to log out-then-in of your graphical session.

AyeBeKey Authenticator Icon AyeBeKey Authenticator Icon Green

For advanced users the optional extras allow you to use your device's biometric reader to perform User Presence; and the TPM to store credentials issued by the authenticator.

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Resources

Support

For issues, questions, or contributions, please use the project's issue tracker.

Metadata

Release files for soft-fido2 0.4.47

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

Source distribution (sdist)

Source distribution for soft-fido2 0.4.47
File Size Uploaded
soft_fido2-0.4.47.tar.gz 124.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soft-fido2 0.4.47
File Interpreter ABI Platform
soft_fido2-0.4.47-py3-none-any.whl Python 3 none any Details

Total release size: 272.7 kB

Release files / soft_fido2-0.4.47.tar.gz

Download URL soft_fido2-0.4.47.tar.gz
Size 124.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0c5ab828b2edd92e6fc3ddbc8d1877ef6092b9ba9886d8a7a2c25368f3b560dc
BLAKE2b-256 checksum
How to use checksums
3aed0c1310c10e63c3664f1c3e1a0e202f44fb23d10d2a36a97720275c5830a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / soft_fido2-0.4.47-py3-none-any.whl

Download URL soft_fido2-0.4.47-py3-none-any.whl
Size 148.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
762f79f47ed17e02a8ffa5043f9ac79baa3686ab4f524416579d347907c82de4
BLAKE2b-256 checksum
How to use checksums
40d6d65c500ed0a458b8500e18d7f1f798f012944e66926a9e5759167cac1273
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release history Release notifications | RSS feed

0.4.52

2 release files

This release

0.4.47 This release

2 release files

0.4.44

2 release files

0.4.29

2 release files

0.4.25

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.2

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