{"id":16696697,"url":"https://github.com/zenithalhourlyrate/canokey-esp32","last_synced_at":"2025-10-08T14:59:05.425Z","repository":{"id":130587036,"uuid":"469354639","full_name":"ZenithalHourlyRate/canokey-esp32","owner":"ZenithalHourlyRate","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-07T16:42:06.000Z","size":61,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T02:54:59.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZenithalHourlyRate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-13T11:45:27.000Z","updated_at":"2025-03-27T16:52:22.000Z","dependencies_parsed_at":"2025-02-16T10:32:44.692Z","dependency_job_id":"e7557057-92ae-4721-9333-ad4fea177c78","html_url":"https://github.com/ZenithalHourlyRate/canokey-esp32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZenithalHourlyRate/canokey-esp32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fcanokey-esp32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fcanokey-esp32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fcanokey-esp32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fcanokey-esp32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZenithalHourlyRate","download_url":"https://codeload.github.com/ZenithalHourlyRate/canokey-esp32/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fcanokey-esp32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278963840,"owners_count":26076544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T17:44:36.243Z","updated_at":"2025-10-08T14:59:05.364Z","avatar_url":"https://github.com/ZenithalHourlyRate.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CanoKey on ESP32 (WIP)\n\nCanoKey is an open-source USB/NFC security token, providing the following functions:\n\n- OpenPGP Card V3.4 (RSA, ECDSA, ED25519 supported)\n- PIV Card\n- TOTP / HOTP (RFC6238 / RFC4226)\n- U2F\n- FIDO2 (WebAuthn)\n\nIt works on modern Linux/Windows/macOS operating systems without additional driver required.\n\n**THERE IS ABSOLUTELY NO SECURITY ASSURANCE OR WARRANTY USING THE ESP32 VERSION.**\n\n**ANYONE WITH PHYSICAL ACCESS CAN RETRIEVE ANY DATA (INCLUDING SECRET KEYS) FROM THE KEY.**\n\n**IT IS ALSO PRONE TO SIDE-CHANNEL ATTACKS.**\n\n**YOU MUST USE IT AT YOUR OWN RISK.**\n\n**A SECURE VERSION CAN BE FOUND AT https://canokeys.org**\n\n## Status\n\nThis is a WIP. Code is not cleaned up and some functions are not implemented currectly (dummy stub).\n\nFunctions like `device_delay`, atomic functions, LED, and touch detection are not implemented.\n\nThe USB stack is now a mixed(缝合) stack, namely driver from tinyUSB but the whole stack from STM32. `usbd_conf.c` is totally a mess. `dcd_esp32sx.c` also needs less hack. The whole stack should be migrated to tinyUSB later.\n\nCurrently many crypto operations may time out or not work due to lack of implementation. I have tested that generating RSA2048 key did not work. Also, signing using RSA4096 would timeout. However, signing using RSA2048/Ed25519 worked.\n\n## Hardware\n\nThis is currently based on ESP32-S2, with ESP32-S2-DevKitC-1 as the development board.\n\nHowever, this should also work on ESP32-S3 as their USB driver is the same. \n\n## Build\n\n0. Clone the repo and all the submodules\n\n1. Setup the ESP-IDF environment, assume it is in `$IDF_PATH`,\n   ```bash\n   source $IDF_PATH/export.sh\n   ```\n\n2. Then configure the project. In `Partition Table` section you should use `Custom Partition Table CSV` (Make sure you have at least 2MB flash) and in `Component config -\u003e ESP System Settings` change `Task Watchdog timeout period` to 60.\n   ```bash\n   idf.py set-target esp32s2\n   idf.py menuconfig\n   ```\n\n3. Then flash and play\n   ```bash\n   sudo -E idf.py -p /dev/ttyUSB0 flash monitor\n   ```\n\n## Initlialize and Test\n\nRef to \u003chttps://github.com/canokeys/canokey-stm32#initialize-and-test\u003e. You should change the PIN in the script from `313131313131` to `313233343536`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithalhourlyrate%2Fcanokey-esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenithalhourlyrate%2Fcanokey-esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithalhourlyrate%2Fcanokey-esp32/lists"}