{"id":19535668,"url":"https://github.com/miyako/4d-plugin-otp","last_synced_at":"2025-02-26T04:17:01.359Z","repository":{"id":223632959,"uuid":"761055922","full_name":"miyako/4d-plugin-OTP","owner":"miyako","description":"OTP","archived":false,"fork":false,"pushed_at":"2024-02-21T14:41:05.000Z","size":39491,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T17:55:28.961Z","etag":null,"topics":["4d-plugin","hotp","totp"],"latest_commit_sha":null,"homepage":"https://miyako.github.io/4d-plugin-OTP","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/miyako.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":"support/4DPlugin-JSON.cpp","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T06:41:57.000Z","updated_at":"2024-02-22T09:28:31.000Z","dependencies_parsed_at":"2025-01-08T18:03:20.375Z","dependency_job_id":null,"html_url":"https://github.com/miyako/4d-plugin-OTP","commit_stats":null,"previous_names":["miyako/4d-plugin-otp"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-OTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-OTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-OTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-OTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyako","download_url":"https://codeload.github.com/miyako/4d-plugin-OTP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788775,"owners_count":19857699,"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":["4d-plugin","hotp","totp"],"created_at":"2024-11-11T02:19:30.473Z","updated_at":"2025-02-26T04:17:01.325Z","avatar_url":"https://github.com/miyako.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![version](https://img.shields.io/badge/version-20%2B-E23089)\n![platform](https://img.shields.io/static/v1?label=platform\u0026message=mac-intel%20|%20mac-arm%20|%20win-64\u0026color=blue)\n[![license](https://img.shields.io/github/license/miyako/4d-plugin-OTP)](LICENSE)\n![downloads](https://img.shields.io/github/downloads/miyako/4d-plugin-OTP/total)\n\nOTP.\n\n* [RFC 6238 Time-Based One-Time Password Algorithm](https://www.ietf.org/rfc/rfc6238.txt)\n* [RFC 4226 HMAC-Based One-Time Password Algorithm](https://www.ietf.org/rfc/rfc4226.txt)\n* Generate random base32 secret by [RAND_bytes](https://www.openssl.org/docs/man1.1.1/man3/RAND_bytes.html), or\n* Use existing secret, base32 or plain text (internally converted to base32)\n* Specify `X` (unix timestamp), `T0` (start time) or compute based on current time\n* Specify hash algorithm\n* Generate [key URI](Key Uri Format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)\n* Generate QRCODE in .png or .svg format\n\n**hotp** code based on [archiecobbs/mod-authn-otp](https://github.com/archiecobbs/mod-authn-otp/tree/master)\n\n# TOTP\n\n```4d\nvar $params : Object\n\n$params:={secret: \"😣.\"; \\\ntype: OTP Type totp; \\\nalgorithm: OTP Algorithm SHA1; \\\nt0: 0; \\\ntimestamp: 1708522781; \\\nperiod: 30; \\\ndigits: 6; \\\nissuer: \"github\"; \\\naccount: \"keisuke.miyako@4d.com\"}\n\n$status:=OTP Generate($params)\n\nASSERT($status.base32_secret=\"6CPZRIZO\")\nASSERT($status.otp=\"219145\")\nASSERT($status.url=\"otpauth://totp/github%3Akeisuke.miyako%404d.com?issuer=github\u0026secret=6CPZRIZO\u0026algorithm=SHA1\u0026digits=6\u0026period=30\")\n\nSET PICTURE TO PASTEBOARD($status.qr)\n```\n\n# HOTP\n\n```4d\nvar $params : Object\n\n$params:={secret: \"😣.\"; \\\ntype: OTP Type hotp; \\\nalgorithm: OTP Algorithm SHA1; \\\ncounter: 1; \\\ndigits: 6; \\\nissuer: \"github\"; \\\naccount: \"keisuke.miyako@4d.com\"}\n\n$status:=OTP Generate($params)\n\nASSERT($status.base32_secret=\"6CPZRIZO\")\nASSERT($status.otp=\"912647\")\nASSERT($status.url=\"otpauth://hotp/github%3Akeisuke.miyako%404d.com?issuer=github\u0026secret=6CPZRIZO\u0026algorithm=SHA1\u0026digits=6\u0026counter=1\")\n\nSET PICTURE TO PASTEBOARD($status.qr)\n```\n\n|key|type||\n|:-:|:-:|:-|\n|secret|Text|if passed, internally encoded to base32_secret|\n|base32_secret|Text||\n|type|Text|totp(default), hotp|\n|algorithm|Text|SHA1(default), SHA256, SHA512|\n|digits|Integer|6(default)|\n|period|Integer|30(default), totp only|\n|t0|Integer|0(default), totp only|\n|timestamp|Integer|default=now, totp only|\n|counter|Integer|0(default), hotp only|\n\n* QR code options\n\n|key|type||\n|:-:|:-:|:-|\n|format|Text|.png(default), .svg|\n|size|Integer|3(default)|\n|dpi|Integer|72(default)|\n|margin|Integer|0(default)|\n|version|Integer|1(default)|\n|level|Integer|0=L(default), 1=M, 2=Q, 3=H|\n\n# Acknowledgements\n\n* [BASE32](https://github.com/mjg59/tpmtotp/blob/master/base32.h) by Adrien Kunysz\n* RFC3986 by [dnmfarrell/URI-Encode-C](https://github.com/dnmfarrell/URI-Encode-C)\n* qrencode by [Kentaro Fukuchi](https://fukuchi.org/works/qrencode/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-otp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyako%2F4d-plugin-otp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-otp/lists"}