{"id":16793512,"url":"https://github.com/mdp/u2fcli","last_synced_at":"2025-04-10T23:53:00.900Z","repository":{"id":66279434,"uuid":"102997893","full_name":"mdp/u2fcli","owner":"mdp","description":"Command line tool for using U2F tokens","archived":false,"fork":false,"pushed_at":"2018-10-31T03:12:06.000Z","size":19,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T23:52:52.034Z","etag":null,"topics":["ecdsa","security","u2f"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdp.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":"2017-09-10T02:28:02.000Z","updated_at":"2022-04-02T17:50:23.000Z","dependencies_parsed_at":"2024-06-20T01:46:47.816Z","dependency_job_id":null,"html_url":"https://github.com/mdp/u2fcli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fu2fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fu2fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fu2fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fu2fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdp","download_url":"https://codeload.github.com/mdp/u2fcli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317703,"owners_count":21083528,"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","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":["ecdsa","security","u2f"],"created_at":"2024-10-13T08:49:31.092Z","updated_at":"2025-04-10T23:53:00.883Z","avatar_url":"https://github.com/mdp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# u2fcli\n\nu2fcli is a tool designed to handle registering, signing, and verifying U2F tokens on the command line.\n\n## Install\n\n`go get github.com/mdp/u2fcli`\n\n## Usage\n\n\n### Registration\n\nChoose a challenge and App ID to send to the U2F device\n\n```\n[mdp u2fcli]$ u2fcli reg --challenge complexChallengeGoesHere \\\n  --appid https://mdp.im\nRegistering, press the button on your U2F device\n\n{\n  \"KeyHandle\": \"0JGeJ3MhvDzK_YjKhK4VkPOegGn0x3wxJENJ8J1JanozbSr8Elz2KRcARLh2sF__l_Vof2xiydPw6CEicpzs0A\",\n  \"PublicKey\": \"BPQPBz7NV3LwksVwjbGdn7ODP5omKHt8CetrHnDZeUUxmFChHcKuYNHgLm0HdtsSD6p7cjrFZdb9mNOLg3huRcI\",\n  \"RegisteredData\": \"0JGeJ3MhvDzK_YjKhK4VkPOegGn0x3wxJENJ8J1JanozbSr8Elz2KRcARLh2sF__l_Vof2xiydPw6CEicpzs0DCCAkQwggEuoAMCAQICBFVivqAwCwYJKoZIhvcNAQELMC4xLDAqBgNVBAMTI1l1YmljbyBVMkYgUm9vdCBDQSBTZXJpYWwgNDU3MjAwNjMxMCAXDTE0MDgwMTAwMDAwMFoYDzIwNTAwOTA0MDAwMDAwWjAqMSgwJgYDVQQDDB9ZdWJpY28gVTJGIEVFIFNlcmlhbCAxNDMyNTM0Njg4MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESzMfdz2BRLmZXL5FhVF-F1g6pHYjaVy-haxILIAZ8sm5RnrgRbDmbxMbLqMkPJH9pgLjGPP8XY0qerrnK9FDCaM7MDkwIgYJKwYBBAGCxAoCBBUxLjMuNi4xLjQuMS40MTQ4Mi4xLjUwEwYLKwYBBAGC5RwCAQEEBAMCBSAwCwYJKoZIhvcNAQELA4IBAQCsFtmzbrazqbdtdZSzT1n09z7byf3rKTXra0Ucq_QdJdPnFhTXRyYEynKleOMj7bdgBGhfBefRub4F226UQPrFz8kypsr66FKZdy7bAnggIDzUFB0-629qLOmeOVeAMmOrq41uxICn3whK0sunt9bXfJTD68CxZvlgV8r1_jpjHqJqQzdio2--z0z0RQliX9WvEEmqfIvHaJpmWemvXejw1ywoglF0xQ4Gq39qB5CDe22zKr_cvKg1y7sJDvHw2Z4Iab_p5WdkxCMObAV3KbAQ3g7F-czkyRwoJiGOqAgau5aRUewWclryqNled5W8qiJ6m5RDIMQnYZyq-FTZgpjXMEUCIEwCqGbDrEYu0F2vVl6IC_5u3M3WVZGm3A6efdh55j1aAiEAooYy3e8q5eakgpXC8FPy0VdGphzV6sjbpuExuJdCqlk\"\n}\n```\n\n### Signing\n\nUsing the `Key Handle` from above, we can ask the U2F token to sign a challenge\n\n```\n[mdp u2fcli]$ u2fcli sig --appid https://mdp.im \\\n  --challenge anotherChallenge \\\n  --keyhandle 0JGeJ3MhvDzK_YjKhK4VkPOegGn0x3wxJENJ8J1JanozbSr8Elz2KRcARLh2sF__l_Vof2xiydPw6CEicpzs0A\nAuthenticating, press the button on your U2F device\n\n{\n  \"Counter\": 33,\n  \"Signature\": \"AQAAACEwRQIgetEQfx2p2SB7ch2JtvDYxjqTekMfZuDPjrJ0deNTXysCIQD5LehJ4gXf1vpJ37_XWefnSkRzwfwZ3Uffq7jWWTZYkw\"\n}\n```\n\n### Verifying\n\nFinally, we can verify the `Signature` from above by providing it to u2fcli along with the `PublicKey` we recieved at registration.\n\n```\n[mdp u2fcli]$ u2fcli ver --appid https://mdp.im \\\n  --challenge anotherChallenge \\\n  --publickey BPQPBz7NV3LwksVwjbGdn7ODP5omKHt8CetrHnDZeUUxmFChHcKuYNHgLm0HdtsSD6p7cjrFZdb9mNOLg3huRcI \\\n  --signature AQAAACEwRQIgetEQfx2p2SB7ch2JtvDYxjqTekMfZuDPjrJ0deNTXysCIQD5LehJ4gXf1vpJ37_XWefnSkRzwfwZ3Uffq7jWWTZYkw\n\nSignature verified\n```\n\n\n## Credit\n\nThis tool wouldn't be possible without the work of https://github.com/flynn/u2f which\nhandles all the interactions with the hardware and USB HID devices\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fu2fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdp%2Fu2fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fu2fcli/lists"}