Coder Social home page Coder Social logo

totp's Introduction

totp

From-scratch, dependency-free implementation of TOTP, including SHA1, for education. TOTP is the most common standard for generating codes in 'Authenticator' apps.

Screenshot

Live web version: https://sjmulder.nl/totp/

Details

Sources:

  • totp.{c,h} - the algorithms.
  • std.{c,h} - some libc functions for freestanding targets (WASM, GBA).
  • main.c - a simple CLI.
  • test.c - unit tests.
  • index.html - a frondend for the WASM build.

Targets:

  • totp - the CLI.
  • totp{32,64}.exe - the CLI, for Windows.
  • totp.wasm - a WebAssembly build, used by index.html.

TOTP generators take a seed (the "shared secret"), which is usually presented as a QR code or base32-encoded string when setting up the authenticator.

This implementation generates codes for the current time given a seed, but the CLI nor the WASM web version store seeds for later use.

Building

  • make to build CLI using default C compiler.
  • make check to run tests.
  • make cross to build Windows and WASM targets.

For Windows and WASM, default compilers and flags are specified in the Makefile but can be overridden with make flags or config.mk, which is automatically included if it exists.

Author

Sijmen Mulder ([email protected]). See LICENSE.md.

totp's People

Contributors

sjmulder avatar

Stargazers

BLE TOU 202 FX National avatar  avatar

Watchers

 avatar  avatar

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.