Skip to content

About

A proof of concept of a vibe coded authentification stick implementing Fido Protocol on Raspberry Pico using Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

rustyRPFKey - FIDO2 Authenticator for RP2350

PROOF OF CONCEPT — EDUCATIONAL USE ONLY

This project is a learning and research exercise. It is not a certified FIDO2 authenticator and must not be relied upon for production security. The code is provided as-is, with absolutely no warranty — express or implied — including but not limited to fitness for a particular purpose, merchantability, or non-infringement. Use it at your own risk. See the License section for full terms.

A FIDO2/CTAP2 authenticator implementation in Rust for the Raspberry Pi RP2350 microcontroller.

📚 Documentation

Architecture & Design (with Mermaid Diagrams)

Compliance & Analysis

Implementation & Testing

🚀 Features

✅ Implemented

  • Core CTAP2 Commands: authenticatorMakeCredential, authenticatorGetAssertion, authenticatorGetInfo, authenticatorReset, authenticatorGetNextAssertion
  • CTAPHID Transport: Full USB HID support with packet assembly
  • Cryptography: ECDSA P-256 and Ed25519 signatures, SHA-256 hashing, AES-256-GCM encryption
  • User Presence: Physical button confirmation
  • PIN Protocol: PIN/UV authentication (protocol v1) with changePIN, getPinUvAuthTokenUsingPinWithPermissions, token permissions, 10-min expiry
  • USB Transport: Configurable VID/PID (default: pid.codes 0x1209:0x0009); override with USB_VID/USB_PID env vars
  • Storage: AES-256-GCM encrypted credential storage (up to 16 credentials), flash-backed with two-slot rotation
  • TRNG: Health tests enabled (VN/CRNGT/autocorr), ChaCha20 CSPRNG seeded from hardware
  • Multi-credential: Full allowList/excludeList processing, getNextAssertion for multiple credentials per RP

⚠️ In Development

  • Full CBOR extension support
  • Resident Key (discoverable credentials)
  • PIN/UV protocol version 2
  • Built-in UV capability advertisement

🔴 Not Production-Ready

  • No formally registered UUID4 AAGUID (build-time model-constant from latest_release git tag SHA is used; must be replaced with a registered UUID4 for FIDO certification)
  • Only “none” attestation format (no attestation key or certificate)
  • Secure boot is disabled by default, although the signing/provisioning scripts are present for production bring-up

See docs/FIDO2_COMPLIANCE_ANALYSIS.md for complete details.

🏗️ Building

# Check code
cargo check

# Build release firmware
cargo build --release

# Flash to device (requires probe-rs or picotool)
./flash_release.sh

🧪 Testing

# Run firmware tests
./test_firmware.sh

# Debug WebAuthn operations
python webauthn_debug.py

⚙️ Build Modes

# Standard firmware build
cargo build --release

# Development-only RAM-backed build (no OTP-backed persistence)
cargo build --release --features dev-mode

# Automated-testing build that bypasses physical approval
cargo build --release --features automatic_user_approval

# Custom USB VID/PID (hex values, no 0x prefix)
USB_VID=1209 USB_PID=0009 cargo build --release

Only the standard build is a candidate for a production image.

📊 Compliance Status

Overall WebAuthn/CTAP2 Compliance: ~75-80%

See docs/COMPLIANCE_SUMMARY.md for quick overview.

Category Status Score Details
Core CTAP2 Commands ⚠️ Partial 85% docs/FIDO2_COMPLIANCE_ANALYSIS.md
WebAuthn Authenticator Model ⚠️ Partial 70% docs/WEBAUTHN_COMPLIANCE.md
Cryptography ✅ Solid 90% Strong crypto primitives
Security Features 🔴 Issues 60% Registered AAGUID, attestation, secure boot, and protocol v2 gaps remain
Privacy Features ✅ Excellent 90% Good privacy posture
Production Ready 🔴 No 0% Critical gaps must be fixed

Critical Issues (Production Blockers):

  1. AAGUID is build-time model-constant (from latest_release git tag SHA) but not a formally registered UUID4 (required for FIDO Alliance certification per WebAuthn §6.1)
  2. Only “none” attestation (violates WebAuthn §6.5)
  3. User verification works through PIN-backed tokens with permission scoping; built-in UV capability is not advertised and protocol v2 is still missing
  4. Secure boot disabled (violates WebAuthn §13.3)
  5. Extensions completely ignored (violates WebAuthn §9)

🔒 Security Status

⚠️ WARNING: NOT PRODUCTION-READY

Critical security issues that must be fixed:

  1. No production AAGUID (device cannot be identified)
  2. No attestation certificate chain
  3. Secure boot disabled

Use for development and testing only.

🤝 Contributing

See FIDO2_TODO.md for prioritized tasks.

Quick Start for Contributors

  1. Close remaining production blockers: production AAGUID, attestation, and secure-boot enablement
  2. Implement remaining WebAuthn/CTAP2.1 gaps: protocol v2, extensions, resident keys, and missing flags
  3. Add automated tests and publication hardening before shipping a public release

📄 License

Licensed under either of

at your option.

The references/ directory contains third-party material used during development only and is not part of the distributable project:

Folder Source License
references/fido/ Chromium Authors BSD-style
references/webauthn/ Microsoft Corporation MIT

These files are excluded from published releases (see .gitignore).

🙏 Acknowledgments

Built with:

  • Rust no_std embedded
  • rp235x-hal / rp-hal embedded support crates
  • p256 for ECDSA
  • usb-device + usbd-hid
  • ssd1306 OLED display driver

Last Updated: 2026-03-31
Target: RP2350 (ARM Cortex-M33)
FIDO Specification: CTAP2 v2.2 (PS 20250714)

About

A proof of concept of a vibe coded authentification stick implementing Fido Protocol on Raspberry Pico using Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages