Skip to content

msantos/totp.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

totp.c: simple, standalone TOTP

totp.c is a small, simple, standalone command line TOTP (RFC6238) without any external dependencies.

totp.c was written by David M. Syzdek.

The standalone hmac_sha1 implementation is by Bob Liu.

Building

# use the default rlimit sandbox
make

# use the seccomp sandbox
RESTRICT_PROCESS=seccomp make clean all

# disable the sandbox
RESTRICT_PROCESS=null make clean all

#### using musl
RESTRICT_PROCESS=rlimit ./musl-make

## linux seccomp sandbox: requires kernel headers

# clone the kernel headers somewhere
cd /path/to/dir
git clone https://github.com/sabotage-linux/kernel-headers.git

# then compile
MUSL_INCLUDE=/path/to/dir ./musl-make clean all

Usage

Usage: totp <b32_key> [ <interval> [ <offset> ] ]

totp YW2N4W7UBAIAEVCT

# 30 second intervals (default)
totp YW2N4W7UBAIAEVCT 30

# previous window
totp YW2N4W7UBAIAEVCT 30 -30

# next window
totp YW2N4W7UBAIAEVCT 30 30

# read key from stdin
echo YW2N4W7UBAIAEVCT | totp - 30

Why?

I needed a simple TOTP application that could be statically linked for use on an old powerpc linux device.

About

simple, standalone TOTP without dependencies

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy