This project transforms your Raspberry RP235x or ESP32 microcontroller into an integrated FIDO Passkey and OpenPGP smartcard, functioning like a standard USB Passkey for authentication and as a smartcard for cryptographic operations.
This is a fork of the last community edition version of the pico-fido2 firmware, from December 9th 2025, that was available on https://github.com/polhenarejos/pico-fido2 before that repository was deleted and replaced by something else.
One-command release build on Windows, macOS and Linux:
python build_firmware_and_controller.py --help
python build_firmware_and_controller.py --qt-path /path/to/Qt/kitThe script checks all required tools, downloads/verifies dependencies and
configures both projects before compiling. Use --check-only to stop after
preflight, --firmware-only to build the ESP32-S3 relay firmware, or
--firmware path/to/esp32s3supermini-<version>.bin to reuse that image and its
adjacent LICENSES/ directory without installing ESP-IDF. See --help for
platform-specific setup and signing options. Packages appear in dist/; every
desktop package includes firmware, Qt GUI, CLI, storage helper and LICENSES/
(inside the app's Contents/Resources on macOS).
macOS defaults to Universal (arm64 + x86_64) for the GUI, CLI, storage
helper and bundled runtime. Supply a Universal Qt 6 kit, such as the official
Qt 6.8.3 macos kit; preflight rejects dependencies missing either architecture.
For a single-architecture build, explicitly pass --macos-arch arm64 or
--macos-arch x86_64 with a matching Qt kit (for example Homebrew Qt).
Firmware and controller release uses this same
script: build firmware once, package it on all three hosts, then publish a
GitHub Release only after every platform succeeds. Run it from Actions with a
new tag, or push a controller-v* tag. Windows is x64; Linux is x64 built on
Ubuntu 22.04; macOS is Universal, with both architectures smoke-tested in CI.
The Linux package includes Qt and non-glibc runtime libraries; the desktop must
provide Secret Service and USB permissions. macOS packages are ad-hoc signed
and are not notarized.
The optional ENABLE_REMOTE_PRESENCE build adds a separate USB HID interface for
the native controller in tools/native-controller (Qt GUI Esp32KeyConfirm and
pico-fido-cli; Windows and Linux, macOS prepared but untested). Each computer
generates its own P-256 key; adding or removing a trusted key needs the physical
BOOT button, and up to four controller keys are stored on the device. A paired
controller can confirm local registrations and logins instead of a BOOT press.
The same BOOT pairing also gives the controller the device's own P-256 public key
(generated on the device, never exported); in relay mode the device signs every
request with it and the safe end accepts only devices it has paired. In the
other direction the safe end's TLS certificate is issued per service start by its
controller key, which the device already trusts: there is no CA, host-name or
certificate lifetime to manage.
The key can also be switched, over USB with a signed configuration and BOOT
confirmation, into relay mode (new_design.md). In relay mode the hardware keeps
its local credentials dormant and forwards CTAP requests over Wi-Fi/TLS (up to ten
Wi-Fi + endpoint profiles) to a "safe end": the controller on a trusted computer,
which stores the private keys in an encrypted local or cloud vault (OneDrive,
Google Drive or WebDAV, coordinated by etcd) and asks for explicit approval of
each registration and login. Relay mode never falls back to local credentials and
never enumerates accounts through the hardware; only an approved exact
site/account query is possible. Lost relay devices can be revoked at the safe end.
- Relay reference: architecture, modes, provisioning, approval and PIN behaviour, backup, cloud storage, security notes and known limits.
- Build, test and CLI reference, including the relay firmware build and the partition-table change for populated devices.
- User guide (Chinese).
The 网站与账号 tab lists the discoverable credentials on a connected key after
verifying its FIDO PIN (on Windows the GUI offers to restart the controller as administrator).
On ESP32, LED_ACTIVITY_ONLY defaults to on and eFuse provisioning to off
(ENABLE_ESP_EFUSE_KEYS=OFF); preserve the NVS and credential partitions when updating.
Enrollment for the exact RP ID apple.com returns packed attestation with the
device certificate, using the same mechanism as the Microsoft RP profile. The
generated certificate includes the WebAuthn-required Authenticator Attestation
organizational unit and non-CA constraints. Legacy locally generated certificates
are upgraded only when their self-signature and public key match; the device key,
PIN and account credentials are retained. Device attestation is hashed with ES256
independently of the new credential's curve.
Website registration and login from an iPhone over USB-C have worked. Apple Account enrollment has not been fully tested, and this self-made device is not FIDO certified, while Apple's requirements call for FIDO-certified security keys. See also the upstream report.
python tools/check_iphone_compat.py (host test dependencies from
tools/requirements-test.txt) verifies canonical CBOR, certificate structure,
attestation and subsequent assertion signatures for ES256, ES384 and ES512 using
nonresident test credentials. On Windows run it from an Administrator terminal.
Add --controller <path to pico-fido-cli> to approve with an already paired
controller; otherwise press BOOT for each request. It prompts for an existing PIN
and never sets or changes one.
| RP2040 | RP2350 | ESP32-S2 | ESP32-S3 | |
|---|---|---|---|---|
| CPU | 2x Cortex-M0+ | 2x Cortex-M33 | 1x Xtensa | 2x Xtensa |
| Core pinning | Yes | Yes | No | Yes |
| RTOS | No (Pico SDK) | No (Pico SDK) | FreeRTOS | FreeRTOS |
| MCU ID | 0 |
1 |
2 |
2 |
Currently most secure features are supported and implemented only for RP2350.
| RP2350 | RP2040 | ESP32-S2 | ESP32-S3 | |
|---|---|---|---|---|
| Secure Boot | Full (boot key hash, CRIT1 flags, debug disable, glitch detector) | No HW support | No (// TODO) |
No (// TODO) |
| Secure Lock | Yes (key invalidation, page locking) | No | No | No |
| MKEK in OTP/eFuse | Yes (OTP rows with ECC, chaff, page locking) | No (plaintext flash) | Yes (eFuse BLK_KEY3, write-locked) |
Yes (eFuse BLK_KEY3, write-locked) |
| Device key in OTP/eFuse | Yes (OTP + chaff + migration) | No | Yes (eFuse BLK_KEY4) |
Yes (eFuse BLK_KEY4) |
cmd_secure APDU |
Available | Not available | Available | Available |
| Firmware signing | Yes (pico_sign_binary) |
No | No | No |
| Rollback protection | Yes | No | No | No |
| HW crypto | SHA-256 | No | SHA-256 + AES-GCM + ECDSA/ECDH | SHA-256 + AES-GCM + ECDSA/ECDH |
Pico FIDO2 includes the following features:
- CTAP 2.1 / CTAP 1
- WebAuthn
- U2F
- HMAC-Secret extension
- CredProtect extension
- User presence enforcement through physical button
- User verification with PIN
- Discoverable credentials (resident keys)
- Credential management
- ECDSA and EDDSA authentication
- Support for SECP256R1, SECP384R1, SECP521R1, SECP256K1 and Ed25519 curves
- App registration and login
- Device selection
- Support for vendor configuration
- Backup with 24 words
- Secure lock to protect the device from flash dumps
- Permissions support (MC, GA, CM, ACFG, LBW)
- Authenticator configuration
- minPinLength extension
- Self attestation
- Enterprise attestation
- credBlobs extension
- largeBlobKey extension
- Large blobs support (2048 bytes max)
- OATH (based on YKOATH protocol specification)
- TOTP / HOTP
- Yubikey One Time Password
- Challenge-response generation
- Emulated keyboard interface
- Button press generates an OTP that is directly typed
- Yubico YKMAN compatible
- Nitrokey nitropy and nitroapp compatible
- Secure Boot and Secure Lock in RP2350 and ESP32-S3 MCUs
- One Time Programming to store the master key that encrypts all resident keys and seeds.
- Rescue interface to allow recovery of the device if it becomes unresponsive or undetectable.
- LED customization with Pico Commissioner.
- OpenPGP card specification v3.4
- 3 key slots (Signature, Encryption, Authentication)
- RSA (2048, 3072, 4096), Ed25519, Curve25519, ECDSA (NIST P-256, P-384, P-521)
- Key generation on device
- Key import/export
- PIN and Admin PIN protection
- Reset and Unblock functions
- Works with GnuPG, SSH, S/MIME, and compatible tools
- CCID over USB
- Compatible with major OS (Linux, Windows, macOS)
- Touch button for user presence confirmation (optional)
- Open source
Microcontrollers RP2350 and ESP32-S3 are designed to support secure environments when Secure Boot is enabled, and optionally, Secure Lock. These features allow a master key encryption key (MKEK) to be stored in a one-time programmable (OTP) memory region, which is inaccessible from outside secure code. This master key is then used to encrypt all private and secret keys on the device, protecting sensitive data from potential flash memory dumps.
However, the RP2040 microcontroller lacks this level of security hardware, meaning that it cannot provide the same protection. Data stored on its flash memory, including private or master keys, can be easily accessed or dumped, as encryption of the master key itself is not feasible. Consequently, if an RP2040 device is stolen, any stored private or secret keys may be exposed.
Before building, ensure you have installed the toolchain for the Pico and that the Pico SDK is properly located on your drive.
git clone https://github.com/youruser/pico-fido2
git submodule update --init --recursive
cd pico-fido2
mkdir build
cd build
PICO_SDK_PATH=/path/to/pico-sdk cmake .. -DPICO_BOARD=board_type -DUSB_VID=0x1D50 -DUSB_PID=0x619B
make
Note that PICO_BOARD, USB_VID and USB_PID are optional. If not provided, pico board and VID/PID 1D50:619B will be used.
Additionally, you can pass the VIDPID=value parameter to build the firmware with a known VID/PID. The supported values are:
NitroHSMNitroFIDO2NitroStartNitroProNitro3Yubikey5YubikeyNeoYubiHSMGnukGnuPG
You can use whatever VID/PID for your own personal use. But remember that you are not authorized to distribute the binary with a VID/PID that you do not own.
The VID/PID 1D50:619B is provided to the project by OpenMoko. It can only be used for builds distributed under a free and open source license.
After running make, the binary file pico_fido2.uf2 will be generated. To load this onto your Pico board:
- Put the Pico board into loading mode by holding the
BOOTSELbutton while plugging it in. - Copy the
pico_fido2.uf2file to the new USB mass storage device that appears. - Once the file is copied, the Pico mass storage device will automatically disconnect, and the Pico board will reset with the new firmware.
- A blinking LED will indicate that the device is ready to work.
To configure your device you can use the picoforge desktop application .
Replace
ESP_PRODUCTwith your SoC's name: e.g.esp32s2oresp32s3ESP_NAMEwith it's full name:ESP32-S2orESP32-S3
Install ESP-IDF and toolchain
git clone --recursive https://github.com/espressif/esp-idf.git -b v5.5 --depth=1
cd esp-idf
./install.sh ESP_PRODUCT
. ./export.sh
cd ..Then, you can build with:
idf.py set-target ESP_PRODUCT
idf.py all
cd build
esptool.py --chip ESP_NAME merge_bin -o pico_fido_esp32.bin @flash_argsThe binary file pico_fido_esp32.bin will be generated. To load this onto your board:
- Put the board into loading mode by holding the
BOOTbutton while plugging it in. - For Windows users, install drivers with this guide
- Go to https://espressif.github.io/esptool-js/
- Click on Connect and choose the board
- Choose the
pico_fido_esp32.binfile - Set Flash Address=0x0000
- Click Program
- Press RST/Reset button on the board. A blinking LED will indicate that the device is ready to work.
To configure your device you can use the picoforge desktop application .
Pico FIDO2 uses the HID driver for FIDO and CCID for OpenPGP, both present in all major operating systems. It should be detected by all OS and browser/applications just like normal USB FIDO keys and smartcards.
This project is released under the GNU Affero General Public License v3 (AGPLv3).
A copy of the AGPLv3 license is available in the LICENSE file.
This project uses libraries and portion of code from other projects that are detailed in the LICENSE file.