Skip to content

SecTrustKey v1.0.0

Choose a tag to compare

@TakMashhido TakMashhido released this 22 Nov 02:35

Important

Superseded by v1.1.1. In this version, setting the startup passphrase restarts the device and nothing is saved. Please update; your keys are kept.

SecTrustKey

The first public release of SecTrustKey: open-source FIDO2 passkey, OpenPGP, PIV and TOTP security key firmware for the M5Stack Cardputer ADV (ESP32-S3). Every request is shown on the device's own screen and approved with Enter.

📖 Documentation: https://koustavmondal.com/SecTrustKey/ · Firmware build #2 (shown under Health and About)

What's in v1.0.0

🔑 FIDO2 and passkeys

  • CTAP 2.0 to 2.3 and U2F over USB HID, no drivers needed
  • Ed25519, ES256, ES384 and ES512
  • Resident passkeys, credential management and FIDO PIN
  • hmac-secret, credProtect, credBlob, largeBlobKey, minPinLength
  • Site and account shown on screen for every registration and sign-in

✍️ OpenPGP, PIV and OATH

  • OpenPGP card with on-device key generation: Curve25519, RSA 2048 to 4096, NIST P-256/384/521, secp256k1, Brainpool
  • Per-key touch policy with an on-screen OpenPGP confirm prompt; works with gpg, SSH and Git signing
  • PIV with PIN, PUK and management key (ykman, OpenSC)
  • OATH TOTP/HOTP and Yubico OTP
  • Resetting one application never touches the others

📟 On the device

  • Home screen with Saved Keys, Codes, Health, Settings and Power Off
  • Live TOTP codes with a countdown; touch-only accounts revealed on Enter
  • Health check that flags factory PINs, a missing FIDO PIN, passphrase or backup, without using a PIN try
  • Progress bars for every long operation, animated boot screen, About page with QR code

🔒 Protecting your keys

  • Optional startup passphrase sealing the master keys at rest (PBKDF2-HMAC-SHA256, AES-256-GCM)
  • Wrong passphrases only add a growing delay (up to 5 minutes), never a wipe
  • Encrypted microSD backup, verify and restore (PBKDF2 600,000 rounds, AES-256-GCM) in a SecTrustKey folder
  • Power-cut safe key store and backups

🛠️ Building

  • Reproducible build in the pinned ESP-IDF v5.5.3 container
  • Custom USB vendor ID, product ID and names with -DUSB_VID, -DUSB_PID, -DUSB_MANUFACTURER, -DUSB_PRODUCT
  • Crash-dump debug build

Install

File Use it for
sectrustkey-v1.0.0-cardputer-adv.bin First install: one image for address 0x0
sectrustkey-v1.0.0-app.bin Updates: firmware only, for address 0x20000; keeps your keys
bootloader.bin, partition-table.bin, ota_data_initial.bin The separate parts (0x0, 0x8000, 0xF000)
stk-time.py Sets the device clock for on-screen TOTP codes
SHA256SUMS.txt Checksums

Put the Cardputer in download mode (power off, hold G0, plug in USB, release G0), then:

pip install esptool
# first install: erases the whole chip, back it up first if it holds anything you want
esptool.py --chip esp32s3 --baud 921600 --after watchdog_reset write_flash --erase-all 0x0 sectrustkey-v1.0.0-cardputer-adv.bin
# update from an earlier SecTrustKey: keeps your keys
esptool.py --chip esp32s3 --baud 921600 --after watchdog_reset write_flash 0x20000 sectrustkey-v1.0.0-app.bin

No Python? Use Espressif's browser flasher: Erase Flash, then program the full image at 0x0. Step by step: Install from a release.

After flashing

  • Change the OpenPGP PINs (factory 123456 / 12345678)
  • Change the PIV PIN, PUK and management key
  • Set a FIDO PIN
  • Consider a startup passphrase
  • Make and verify an SD backup
  • Keep a second authenticator on every account that matters

See First steps.

Known limitations

  • The ESP32-S3 is not a secure element, and Secure Boot and flash encryption are not enabled: without a startup passphrase, someone who can read the flash can copy the keys. Read the security model.
  • The clock is lost at power-off; run stk-time.py to see codes on screen.
  • OpenPGP and PIV have been tested on Linux; on Linux, pcscd needs the device's USB ID added once.

Checksums (SHA-256)

371bd3e5a4879ab498664fa10d498ad945acf91a5c0c2428702c53c43029eba4  sectrustkey-v1.0.0-cardputer-adv.bin
1d85fa3f93562c347275628118fadd1d731e37cb350a910cafc04c3c22918046  sectrustkey-v1.0.0-app.bin
df2770c75f4f7b3e2130dcc0bf068de5885ef1558aeae38dd1f6e0e925c8386a  bootloader.bin
f0c9ecd573c003b76e205bedfff011133bfc813ab65018d30c5adc633ea665e5  partition-table.bin
7d2c7ac4888bfd75cd5f56e8d61f69595121183afc81556c876732fd3782c62f  ota_data_initial.bin
a8f4b716baa7bf4c18f9af84b759b86fc8327fd8acd0e93bdfe565e0e07c48da  stk-time.py

Built from commit c53fa8a with ESP-IDF v5.5.3. Licensed under the GNU AGPL v3.0. Built on Pico FIDO, Pico OpenPGP and the Pico Keys SDK by Pol Henarejos, and the Cardputer ADV port by lessucettes.