Giter Club home page Giter Club logo

otp's Introduction

Time-Based Ephemeral Password Generator (TOTP)

This module provides functionality for generating time-based ephemeral passwords (TOTP) based on a master key following the RFC 6283 specification.

It includes functions for generating the master key, decrypting it, generating counters, truncating hash values, computing TOTP values, and generating ephemeral keys.

It includes functions for generating the master key, decrypting it, generating counters, truncating hash values, computing TOTP values, and generating ephemeral keys.

Getting Started

Requirements

To run this project, ensure you have:

Python3
Pip3
Make

Installation

  1. Clone the repository:
  git clone https://github.com/louisabricot/OTP
  cd OTP
  1. Install the required packages:
  make install
  1. Setup the project:
  make

Usage

The script can be run in two modes:

Generate the master key from a 64-character hexadecimal value.
Generate a time-based ephemeral password from the master key.
  1. To generate the master key:
python script.py --master-key <64-character-hexadecimal-value>
  1. To generate a time-based ephemeral password:
python script.py --key [-d <digits>] [-v]

Options

--master-key, -m <64-character-hexadecimal-value>:
Generate the master key from a 64-character hexadecimal value.

--key, -k:
Generate a time-based ephemeral password from the master key.

--digits, -d <digits>:
The length of the TOTP password (default is 6 digits).

--verbose, -v:
Display detailed steps while generating the password.

Example

Generate a master key:

python script.py --master-key 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF

Generate a time-based ephemeral password:

python script.py --key -d 6 -v

Running Tests

To run tests:

  make test

Reference

RFC6238

otp's People

Contributors

louisabricot avatar

Watchers

 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.