A test server and web UI for WebAuthn/FIDO2 registration and authentication. It displays the selected algorithm, authenticator flags (UP/UV/AT/ED/BE/BS), sign counter, and extension results (credProps, PRF, largeBlob) for validation. This test app also supports functionalities such as decoder, FIDO MDS explorer, etc.
Built on python-fido2-PQC, which extends Yubicoβs python-fido2. Classical algorithms work by default.
Scope - Includes: Python, virtual environment, Flask, python-fido2, and Post-Quantum Crypto (PQC) algorithm options.
-
Windows 10/11 (64-bit)
-
macOS (Intel or Apple Silicon)
A modern browser with WebAuthn support is required: - Edge, Chrome, Safari, Firefox
-
Git: (https://git-scm.com/)
-
Python 3.12+ (64-bit) with pip (https://www.python.org/downloads/)
git clone https://github.com/rainzhang05/python-fido2-webauthn-test.git
cd python-fido2-webauthn-test
# Create and activate a virtual environment
py -3.12 -m venv .venv
.\.venv\scripts\activate
# Upgrade pip and install runtime dependencies
python -m pip install --upgrade pip
pip install fido2 flask cryptography cbor2
# Optional: PC/SC smart card extras
pip install "fido2[pcsc]"
Windows (PowerShell):
.\.venv\Scripts\Activate
macOS:
source .venv/bin/activate
Using pip / virtualenv
pip install ".[pqc]"
python -c "import oqs"
# Clone liboqs
git clone --branch main https://github.com/open-quantum-safe/liboqs.git
cd liboqs
# Configure build
cmake -S . -B build -DOQS_BUILD_SHARED_LIBS=ON -DOQS_USE_OPENSSL=OFF
# Build in Release mode
cmake --build build --config Release
Output: build\bin\Release\oqs.dll
Copy the DLL into your Python venv so oqs can find it:
copy build\bin\Release\oqs.dll C:\path\to\your\venv\Lib\site-packages\oqs\
Or add the folder to your PATH.
# Clone liboqs
git clone --branch main https://github.com/open-quantum-safe/liboqs.git
cd liboqs
# Configure and build
cmake -S . -B build -DOQS_BUILD_SHARED_LIBS=ON -DOQS_USE_OPENSSL=OFF
cmake --build build --config Release
Output: build/lib/liboqs.dylib
Copy to your venv:
cp build/lib/liboqs.dylib /path/to/venv/lib/python3.X/site-packages/oqs/
Or add to DYLD_LIBRARY_PATH:
export DYLD_LIBRARY_PATH=$PWD/build/lib:$DYLD_LIBRARY_PATH
Make sure you already built and installed liboqs (the C library). Now, clone and install the Python wrapper:
# Go to home directory
cd ~
# Clone liboqs-python
git clone https://github.com/open-quantum-safe/liboqs-python.git
cd liboqs-python
# Install into your active virtual environment
pip install .
From your project root (where your .venv
is located):
cd ~/IdeaProjects/python-fido2-webauthn-test
python -c "import oqs; print(oqs.get_version()); print(oqs.get_enabled_sigs())"
If installed correctly, you should see something like:
0.14.0-dev
['ML-DSA-44', 'ML-DSA-65', 'ML-DSA-87', ...]
This indicates the version number and supported algorithms. Make sure all PQC algorithm that you would like to use appears in the list above.
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install mkcert via Chocolatey
choco install mkcert -y
Windows (PowerShell)
cd C:\path\to\your\project
mkcert localhost 127.0.0.1 ::1
macOS (Terminal)
cd /path/to/your/project
mkcert localhost 127.0.0.1 ::1
localhost
, not 127.0.0.1
.
- Rename files to:
- localhost+1.pem
- localhost+1-key.pem
Otherwise, the program will fail to run.
Windows (PowerShell)
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
macOS
python3 -m venv .venv
source .venv/bin/activate