Giter VIP home page Giter VIP logo

otp's Introduction

otp - One Time Password generation with Bash

This script generates Hash-based One Time Passwords (HOTP) and Time-based One Time Passwords (TOTP).

It's written in bash, and has a minimal set of dependencies.

HMACs are calculated with OpenSSL, and date/string manipulation is done with GNU coreutils.

Installation

To install, simply put the otp script in your $PATH.

Make sure to install the required dependencies. This has been tested with dependencies installed by Homebrew on Mac and Linuxbrew on Amazon Linux.

After installing Homebrew or Linuxbrew, simply run:

brew install coreutils openssl bash

Status

The script implements HOTP and TOTP, with arbitrary number of digits, and supports multiple hashing algorithms. It passes all the tests from the specs, including sha1, sha256, and sha512 TOTPs.

The script parses cmd line arguments, and generates HOTP and TOTP values according to the otp options specified.

To see what options are available, try:

./otp --help

Roadmap

  • Implement generating a few past and future TOTP codes (to help with sync)

  • Implement URI parsing

  • Implement STDIN processing

The stdin use case is intended to allow easy integration with command-line based secret storage, such as https://www.passwordstore.org/, or https://github.com/lastpass/lastpass-cli.

Specs

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.