Giter Site home page Giter Site logo

totp.c's Introduction

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.

totp.c's People

Contributors

msantos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

binrick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.