Hacker GitHub

← All repos

susam/mintotp

View on GitHub ↗ ★ 1,401 Python

Minimal TOTP generator in 20 lines of Python

16 mentions on Hacker News by 6 people: 6 stories, 10 comments · first 2019-10-19 · latest 2026-01-19

Mentions per year 16 mentions · busiest year 2021 (5)
20082026
  1. Original source of the 8 liner Python code: https://github.com/susam/mintotp/blob/main/mintotp.py
  2. …4 years ago. Write the seed on a Post-It and you're all set. Not so convenient, but sound sleeping! https://github.com/susam/mintotp
  3. It is a bit terse, but there is a 20-line Python implementation which cleared up the ideas for me: https://github.com/susam/mintotp
  4. …if you have your secret key on hand, you can generate your TOTP code with just 30 lines of Python!: https://github.com/susam/mintotp/blob/main/mintotp.py It's amazing! Its default UX assumes you're basically air gapped. It works based on a…
    comment by lelandbatey · 2025-03-02 · in Towards a test suite for TOTP codes
  5. …well, so a python TOTP generator can be pretty small, 30 lines in this case...and not too golfed: https://github.com/susam/mintotp/blob/main/mintotp.py
    comment by tyingq · 2024-02-26 · in TOTP Codes in the Terminal
  6. …equivalent of what Google's offering here. Is there a "KeePassX" of the passkey world? [0] - https://github.com/susam/mintotp/blob/main/mintotp.py
    comment by lelandbatey · 2023-05-04 · in Google Introduces Passkey Authentication
  7. …minitotp[0] which only uses the Python standard library available from Python 3.4 and above. [0] https://github.com/susam/mintotp
    comment by fbdab103 · 2023-05-04 · in TOTP Authentication with Free Software
  8. A little golfed, but TOTP in python, using only base/included modules, is not much code. https://github.com/susam/mintotp/blob/main/mintotp.py
    comment by tyingq · 2023-05-04 · in TOTP Authentication with Free Software
  9. …of ps -ef too thereby exposing the secrets to other users. By the way, I have a similar script at https://github.com/susam/mintotp but it reads secrets from the standard input (as opposed to reading from command line arguments), one secret…
  10. …that might look like, I have a 30-line Python code here (TOTP generation only, no verification): https://github.com/susam/mintotp . Indeed the core function (the HOTP function) contains only 6 lines, thanks to Python's extensive standard…