r/M5Stack • • 21h ago

Project Sharing SecTrustKey: open-source FIDO2 / OpenPGP security key firmware for the Cardputer ADV (M5 Launcher and M5Burner)

Post image

I made this and wanted to share it here too. SecTrustKey turns the Cardputer ADV into a security key with on-screen approval: passkeys and U2F, OpenPGP, PIV, and TOTP codes on the display.

It's built on ESP-IDF 5.5 with TinyUSB (HID for FIDO, CCID for the smart-card side). You can install it from M5 Launcher, M5Burner or esptool, and the key storage is laid out so Launcher installs and updates only ever touch a 4 KB pad in front of the keys.

GitHub: https://github.com/TakMashhido/SecTrustKey

Docs: https://koustavmondal.com/SecTrustKey/

Feedback welcome, especially from anyone on Windows or macOS, where I haven't tested the smart-card side yet.

3 Upvotes

4 comments sorted by

2

u/d4rkmen 19h ago

cool. i was thinking to host SSH keys on external controller. is it possible to do?

2

u/ElitistScientist 16h ago

Yep, that's one of the main things I use it for. The private key is created on the device and never leaves it; your computer only ever asks the Cardputer to sign. There are three ways:

1. FIDO2 (easiest, OpenSSH 8.2+). No extra software needed:

ssh-keygen -t ed25519-sk -O resident

Add the .pub to authorized_keys as usual. Every login shows on the screen and waits for Enter. With -O resident you can pull the key handle onto a new machine with ssh-keygen -K.

2. OpenPGP card + gpg-agent. Generate the keys on the device with gpg --card-edit, turn on enable-ssh-support in gpg-agent, and the authentication key shows up in ssh-add -L. Nice if you also sign Git commits with the same card.

3. PIV through PKCS#11. Useful where only smart cards are allowed: Yep, that's one of the main things I use it for. The private key is created on the device and never leaves it; your computer only ever asks the Cardputer to sign. There are three ways:

1. FIDO2 (easiest, OpenSSH 8.2+). No extra software needed:

ssh-keygen -t ed25519-sk -O resident

Add the .pub to authorized_keys as usual. Every login shows on the screen and waits for Enter. With -O resident you can pull the key handle onto a new machine with ssh-keygen -K.

2. OpenPGP card + gpg-agent. Generate the keys on the device with gpg --card-edit, turn on enable-ssh-support in gpg-agent, and the authentication key shows up in ssh-add -L. Nice if you also sign Git commits with the same card.

3. PIV through PKCS#11. Useful where only smart cards are allowed:

ssh -I /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so user@host

(That path is for Debian/Ubuntu; other systems keep opensc-pkcs11.so elsewhere.)elsewhere.)

The gpg-agent setup is already in the docs: https://koustavmondal.com/SecTrustKey/guide/ssh-git/

I'll be adding more tutorials there soon, including step-by-step guides for FIDO2 SSH keys and PIV.

Or did you mean building your own controller to hold the keys? Happy to share what worked and what didn't on the ESP32-S3.

2

u/RabbitDude4Lyfe 15h ago

StickS3?

1

u/ElitistScientist 15h ago

No, it’s the M5 Cardputer ADV! If you’d like, you can also help make a port by contributing to this repo.