Skip to content

Instantly share code, notes, and snippets.

@Tpaefawzen
Last active January 6, 2025 10:05
Show Gist options
  • Select an option

  • Save Tpaefawzen/d756ec40dedb3d125a0859efe7914975 to your computer and use it in GitHub Desktop.

Select an option

Save Tpaefawzen/d756ec40dedb3d125a0859efe7914975 to your computer and use it in GitHub Desktop.
Manual page for angt/totp: A tiny command line utility to generate OTP tokens https://github.com/angt/totp?tab=readme-ov-file
.Dd January 6, 2024
.Dt TOTP 1
.Os
.Sh NAME
.Nm totp
.Nd A tiny command line utility to generate OTP tokens
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
Reads a line of binary secret to output a six-digit TOTP code;
sha1 algorithm and 30-second period only.
.Sh EXAMPLES
Add a new TOTP key using
.Xr secret 1 ;
.D1 echo -n JBSWY3DPEHPK3PXP | base32 -d | secret set test/totp
Then, generate a TOTP token:
.D1 secret show test/totp | totp
Add a new TOTP key using
.Xr pass 1 ;
.D1 echo -n JBSWY3DPEHPK3PXP | base32 -d | pass insert -e test/totp
Then, generate a TOTP token:
.D1 pass test/totp | totp
Copy and paste to the clipboard using
.Xr xclip 1 ;
.D1 pass test/totp | totp | xclip
.Sh SEE ALSO
.Lk https://github.com/angt/totp?tab=readme-ov-file
.Sh SECURITY CONSIDERATIONS
Only first 64 bytes shall be read using
.Xr read 2
system call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment