{"id":20424194,"url":"https://github.com/itpey/motp","last_synced_at":"2026-02-15T23:07:16.828Z","repository":{"id":242623442,"uuid":"809763548","full_name":"itpey/motp","owner":"itpey","description":"Go Mobile-OTP (mOTP) generator. ","archived":false,"fork":false,"pushed_at":"2024-11-21T22:32:39.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T19:01:04.392Z","etag":null,"topics":["cli","cliapp","go","golang","golang-library","golang-module","golang-package","mobileotp","motp","onetimepassword","otp","secret","secrets","security"],"latest_commit_sha":null,"homepage":"https://github.com/itpey/motp","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/itpey.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-03T12:04:29.000Z","updated_at":"2024-11-27T20:21:38.000Z","dependencies_parsed_at":"2024-06-11T01:30:45.875Z","dependency_job_id":null,"html_url":"https://github.com/itpey/motp","commit_stats":null,"previous_names":["itpey/motp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/itpey/motp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fmotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fmotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fmotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fmotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itpey","download_url":"https://codeload.github.com/itpey/motp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fmotp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29491999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","cliapp","go","golang","golang-library","golang-module","golang-package","mobileotp","motp","onetimepassword","otp","secret","secrets","security"],"created_at":"2024-11-15T07:08:54.177Z","updated_at":"2026-02-15T23:07:16.790Z","avatar_url":"https://github.com/itpey.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # \"Title: motp\"\n[//]: # \"Author: itpey\"\n[//]: # \"Attendees: itpey\"\n[//]: # \"Tags: #itpey #go #motp #golang #go-lang #cli #password #otp\"\n\n\u003ch1 align=\"center\"\u003e\n MOTP\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nmotp is a Go package that provides a \u003ca href=\"https://motp.sourceforge.net\"\u003eMobile-OTP (mOTP)\u003c/a\u003e generator. This package allows you to generate time-based one-time passwords (OTP) using a secret key and a PIN.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/itpey/motp\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/itpey/motp.svg\" alt=\"itpey motp Go Reference\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/itpey/motp/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/itpey/motp\" alt=\"itpey motp license\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Features\n\n- Configurable period for OTP validity\n- Configurable number of digits in the OTP\n- Generates OTP based on the current Unix timestamp\n\n## Installation\n\nTo install the package, use the following command:\n\n```bash\ngo get github.com/itpey/motp\n```\n\n## Usage\n\n### Creating a New MOTP Instance\n\nYou can create a new MOTP instance by specifying a secret key and a PIN. Optionally, you can configure the period and the number of digits for the OTP.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"github.com/itpey/motp\"\n)\n\nfunc main() {\n    // Create a new MOTP instance with default settings\n    motpInstance, err := motp.New(\"your_secret_key\", \"your_pin\")\n    if err != nil {\n        log.Fatalf(\"Error creating MOTP instance: %v\", err)\n    }\n\n    // Generate an OTP based on the current Unix timestamp\n    otp, err := motpInstance.GenerateCurrent()\n    if err != nil {\n        log.Fatalf(\"Error generating OTP: %v\", err)\n    }\n\n    fmt.Printf(\"Generated OTP: %s\\n\", otp)\n}\n```\n\n### Configuring the Period and Number of Digits\n\nYou can customize the period and the number of digits in the OTP by using functional options:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"github.com/itpey/motp\"\n)\n\nfunc main() {\n    // Create a new MOTP instance with custom period and digits\n    motpInstance, err := motp.New(\"your_secret_key\", \"your_pin\", motp.WithPeriod(30), motp.WithDigits(8))\n    if err != nil {\n        log.Fatalf(\"Error creating MOTP instance: %v\", err)\n    }\n\n    // Generate an OTP based on the current Unix timestamp\n    otp, err := motpInstance.GenerateCurrent()\n    if err != nil {\n        log.Fatalf(\"Error generating OTP: %v\", err)\n    }\n\n    fmt.Printf(\"Generated OTP: %s\\n\", otp)\n}\n```\n\n# CLI Tool\n\nThe motp-cli is a command-line tool for generating one-time passwords (OTPs) using the \u003ca href=\"https://motp.sourceforge.net\"\u003eMobile-OTP (mOTP)\u003c/a\u003ealgorithm. It allows you to specify a secret key and a PIN to generate a unique OTP based on the current time period.\n\n## Installation\n\nMake sure you have Go installed and configured on your system. Use go install to install motp-cli:\n\n```bash\ngo install github.com/itpey/motp/cmd/motp@latest\n```\n\nEnsure that your `GOBIN` directory is in your `PATH` for the installed binary to be accessible globally.\n\n## Usage\n\n**$ motp** --secret `your_secret_key` --pin `your_pin` --duration `duration` --length `length`\n\nFlags\n\n- `--secret, -s`: mOTP secret value (often hex or alphanumeric digits) **[required]**\n- `--pin, -p`: mOTP PIN value (usually 4 digits) **[required]**\n- `--duration, -d`: Duration of mOTP codes in seconds (default 10s) **[optional]**\n- `--length, -l`: Length of mOTP output (default 6 characters) **[optional]**\n\n## Example\n\n**$ motp** --secret `mysecret` --pin `1234` --duration `30` --length `8`\n\n# Feedback and Contributions\n\nIf you encounter any issues or have suggestions for improvement, please [open an issue](https://github.com/itpey/motp/issues) on GitHub.\n\nWe welcome contributions! Fork the repository, make your changes, and submit a pull request.\n\n# License\n\nmotp is open-source software released under the MIT License. You can find a copy of the license in the [LICENSE](https://github.com/itpey/motp/blob/main/LICENSE) file.\n\n# Author\n\nmotp was created by [itpey](https://github.com/itpey)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fmotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitpey%2Fmotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fmotp/lists"}