Skip to content

k-stha/otpgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otpgen

Module for generating HOTP and TOTP codes

Table of Contents

Description

This repository contains a library called otpgen which could be used to obtain HOTP and TOTP codes, and an example script called totpgen.py, which is created to demonstrate what the library can be used to create.

Library Usage

To generate HOTP code from library:

>>> from otpgenlib.otpgen import hotp
>>> hotp("<HOTP_SECRET>", <COUNT>)

To generate TOTP code from library:

>>> from otpgenlib.otpgen import totp
>>> totp("<TOTP_SECRET", <COUNT>)

Script Usage

To generate TOTP code from totpgen.py script:

$ totpgen.py "<TOTP_SECRET>"
$ # OR
$ echo "<TOTP_SECRET>" | totpgen.py -

RECOMMENDATION: Encrypt the file with the TOTP Secret using tools like GnuPG, and pass its contents to the scripts.

$ totpgen.py "$(gpg -qd /file/with/totp/secret)"
$ # OR
$ gpg -qd /file/with/totp/secret | totpgen.py -

Contribution Guidelines

See CONTRIBUTING.md

About

Module for generating HOTP and TOTP codes

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages