{"id":19041355,"url":"https://github.com/andreyrusyaev/simpleauthenticator","last_synced_at":"2025-04-23T21:27:22.367Z","repository":{"id":258795698,"uuid":"586540756","full_name":"AndreyRusyaev/simpleauthenticator","owner":"AndreyRusyaev","description":"Cross-platform console C#/.Net implementation to generate one time passwords (TOTP/HOTP) for open authentication defined by standard RFC's (4226, 6238). Compatible with Google/Microsoft Authenticator apps.","archived":false,"fork":false,"pushed_at":"2025-01-12T20:30:42.000Z","size":34,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T06:51:18.144Z","etag":null,"topics":["google-authenticator","hotp","hotp-generator","microsoft-authenticator","one-time-password","otp","otp-generator","rfc4226","rfc6238","totp","totp-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","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/AndreyRusyaev.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,"zenodo":null}},"created_at":"2023-01-08T14:06:38.000Z","updated_at":"2025-03-02T11:20:50.000Z","dependencies_parsed_at":"2025-04-17T17:59:51.075Z","dependency_job_id":"941c9381-a768-4e5d-94e6-d21b357ae0db","html_url":"https://github.com/AndreyRusyaev/simpleauthenticator","commit_stats":null,"previous_names":["andreyrusyaev/simpleauthenticator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Fsimpleauthenticator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Fsimpleauthenticator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Fsimpleauthenticator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Fsimpleauthenticator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreyRusyaev","download_url":"https://codeload.github.com/AndreyRusyaev/simpleauthenticator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250516590,"owners_count":21443645,"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":["google-authenticator","hotp","hotp-generator","microsoft-authenticator","one-time-password","otp","otp-generator","rfc4226","rfc6238","totp","totp-generator"],"created_at":"2024-11-08T22:28:45.254Z","updated_at":"2025-04-23T21:27:22.346Z","avatar_url":"https://github.com/AndreyRusyaev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# simpleauthenticator\nCross-platform C#/.Net implementation to generate one time passwords for open authentication defined by standard RFC's:\n* [HOTP: An HMAC-Based One-Time Password Algorithm](https://www.rfc-editor.org/rfc/rfc4226),\n* [TOTP: Time-Based One-Time Password Algorithm](https://www.rfc-editor.org/rfc/rfc6238)\n\nCompatible with Google/Microsoft Authenticator and other authenticators that supports corresponding RFC's.\n\n## How to run it\n\nEnsure that .Net 8 or later is installed\n```\ndotnet --version\n```\n\nClone repository and run `totp` or `hotp` command:\n``` shell\ngit clone https://github.com/AndreyRusyaev/simpleauthenticator\ncd simpleauthenticator\ndotnet run totp -s \"\u003cyour base32 encoded secret key\u003e\"\n```\n\nOutput:\n```shell\nToken: 123456 (valid for 25 seconds).\n```\n\n# Prerequisites\n.Net 8.0 or higher.\n\n\u003cdetails\u003e\n  \u003csummary\u003eHOWTO: Install .NET 8 on Windows, Linux, and macOS\u003c/summary\u003e\n  \n### Windows\n``` shell\n# run in elevated shell\nwinget install Microsoft.DotNet.SDK.8\n```\n\n### Ubuntu\n``` shell\n# Register Microsoft packages feed (https://learn.microsoft.com/en-us/linux/packages)\nwget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb\nsudo dpkg -i packages-microsoft-prod.deb\nrm packages-microsoft-prod.deb\n\n# installation\nsudo apt update \u0026\u0026 sudo apt-get install -y dotnet-sdk-8.0\n```\n\n### MacOS\n``` shell\nbrew install dotnet\n```\n\n### See also\n[Install .NET on Windows, Linux, and macOS](https://learn.microsoft.com/en-us/dotnet/core/install/)\n\n\u003c/details\u003e\n\n# Usage\n\n```\nDescription:\n  Generates one time passwords (HOTP and TOTP tokens).\n\nUsage:\n  simpleauthenticator [command] [options]\n\nOptions:\n  --version       Show version information\n  -?, -h, --help  Show help and usage information\n\nCommands:\n  totp  Generates time based one time password (TOTP token, RFC 6238).\n  hotp  Generates hmac based one time password (HOTP token, RFC 4226).\n\ntotp Command Options:\n  -s, --secretkey, --secretkey-base32 \u003csecretkey-base32\u003e  Base32 encoded secret key (whitespaces allowed). Example:\n                                                          'A5YS 2UP6 K4UF 46GD'.\n  -s64, --secretkey-base64 \u003csecretkey-base64\u003e             Base64 encoded secret key (whitespaces allowed). Example:\n                                                          'B3Et Uf5X KF54 ww=='.\n  --token-length \u003ctoken-length\u003e                           Token length. Default: 6.\n\nhotp Command Options:\n  -s, --secretkey, --secretkey-base32 \u003csecretkey-base32\u003e  Base32 encoded secret key (whitespaces allowed). Example:\n                                                          'A5YS 2UP6 K4UF 46GD'.\n  -s64, --secretkey-base64 \u003csecretkey-base64\u003e             Base64 encoded secret key (whitespaces allowed, '=' can be omited). Example:\n                                                          'B3Et Uf5X KF54 ww=='.\n  -c, --counter \u003ccounter\u003e (REQUIRED)                      8-byte counter value, the moving factor.  This counter\n                                                          MUST be synchronized between the HOTP generator (client)\n                                                          and the HOTP validator (server).\n  --token-length \u003ctoken-length\u003e                           Token length. Default: 6.\n```\n\n# Examples\n\n## TOTP: Generate time-based one time password\n``` shell\ngit clone https://github.com/AndreyRusyaev/simpleauthenticator\ncd simpleauthenticator\ndotnet run totp --secretkey \"A5YS 2UP6 K4UF 46GD\"\n```\n\nOR\n\n``` shell\ngit clone https://github.com/AndreyRusyaev/simpleauthenticator\ncd simpleauthenticator\ndotnet run totp --secretkey-base64 \"B3Et Uf5X KF54 ww==\"\n```\n\nOutput:\n``` shell\nToken: 316788 (valid for 25 seconds).\n```\n\n## HOTP: Generate HMAC-based one time password\n\n``` shell\ngit clone https://github.com/AndreyRusyaev/simpleauthenticator\ncd simpleauthenticator\ndotnet run hotp --counter 12345 --secretkey \"A5YS 2UP6 K4UF 46GD\"\n```\n\nOR\n\n``` shell\ngit clone https://github.com/AndreyRusyaev/simpleauthenticator\ncd simpleauthenticator\ndotnet run hotp --counter 12345 --secretkey-base64 \"B3Et Uf5X KF54 ww==\"\n```\n\nOutput:\n``` shell\nToken: 316788.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyrusyaev%2Fsimpleauthenticator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreyrusyaev%2Fsimpleauthenticator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyrusyaev%2Fsimpleauthenticator/lists"}