GithubHelp home page GithubHelp logo

ericonr / get-otp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 20 KB

Homebrewn solution for comfortably turning OTP secrets into access tokens from the command line

License: ISC License

C 75.63% Shell 16.43% Makefile 7.94%
otp oath-toolkit bearssl argon2 jq fzf wayland

get-otp's Introduction

get-otp

This repository holds a combination of tools that can be used to (comfortably) generate TOTP 2FA access tokens on the desktop, instead of depending on a phone app.

get-otp

Main tool, depends on:

It will use the cbc-file executable from this project to decrypt a ~/.local/share/otp_accounts file, whose decrypted contents should be in the same format as exported by andOTP. It can then run a menu, using fzf, to let you choose the account for which you want an access token. If running on Wayland, the token will also be copied to the clipboard.

$ get-otp [account_name]

encrypt-otp

This tool doesn't depend on anything besides cbc-file. What it does is encrypt the file passed to it (which should be in the format exported by andOTP, as mentioned above) and put the encrypted file in the correct place.

$ encrypt-otp otp_accounts.json

cbc-file

Mostly hidden utility, does the encryption magic. Despite the name, uses ChaCha20+Poly1305 for encryption, as implemented by BearSSL, together with argon2 for key derivation.

Both of the mentioned libraries are necessary for building this utility. On Linux, a kernel which implements the getrandom(2) syscall is necessary, since it is the backend for getentropy(3), which is the only random number backend implemented.

Disclaimer

This is experimental code and ideas, and shouldn't be put anywhere near any sort of production. However, I am open to suggestions and improvements, so feel free to reach out.

get-otp's People

Contributors

ericonr 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.