hotp-ts

HOTP: An HMAC-Based One-Time Password Algorithm Typescript Library


Keywords
HTOP, RFC, Security
License
MIT
Install
npm install hotp-ts@2.0.1

Documentation

HOTP-TS

Typescript implementation of:

Works both in node and browser environment.

Usage

Install:

npm install hotp-ts

HOTP

import { generateHOTP } from "hotp-ts";

let hotp = await generateHOTP("some-secret-to-share-with-server", 0);

TOTP

import { generateTOTP } from "hotp-ts";

let totp = await generateTOTP("some-secret-to-share-with-server", {
  timestamp: Date.now(),
});

OCRA

import { generateOCRA } from "hotp-ts";

let ocraResponse = await generateOCRA("secret", {
  suite: "OCRA-1:HOTP-SHA256-8:QN08-PSHA1",
  question: "00000000",
  passwordHash: "7110eda4d09e062aa5e4a390b0a572ac0d2c0220",
});