Giter Site home page Giter Site logo

twothy's Introduction

Twothy

Build Status GitHub tag License GitHub issues Contributions welcome GitHub pull requests Website

Twothy is a Two-factor authenticator for CLI. The project is a reference implementation of RFC 6238 and is compatible with Google Authenticator. The project was born out of frustration to get OTP from my Mobile and lack of control over and backup of Secrets. With a simple configuration, twothy can work across multiple devices without the need to regenerate the secrets for each 2FA enabled accounts. More here

Getting Started

Installation assumes that you have Go environment configured.

Installing

Go get the project with following command

go get -u github.com/vedhavyas/twothy/cmd/twothy/...

Running the tests

Once inside project' folder, simply run make test to run the tests.

Usage

Configuring twothy

Twothy requires you to provide a path to store the accounts. Configuration can be triggered by

>> twothy configure
Welcome to twothy!!
Enter the path to store your 2FA accounts.
I will create 'twothy_accounts' folder at the provided path.
If you are restoring accounts, provide path to 'twothy_accounts'.
Path(/Users/vedhavyas):

Once you enter path, which defaults to user's home directory if not given, twothy will store all the accounts there. Configure will be triggered if any other action is called ex: add

Adding an account

Adding account requires Issuer, Label and the secret Key.

>> twothy add google test MZZWCLDCOZSGMYTKONSGM===
Password(to encrypt the account):
test@google: 168339

Generating OTPs

Generating OTP for all accounts

>> twothy otp
Password(to decrypt the account):
test@google: 772912

Generating OTPs for all accounts belonging to an issuer

>> twothy otp google
Password(to decrypt the account):
test@google: 017934

Generating OTP for an account matching issuer and label

>> twothy otp google test
Password(to decrypt the account):
test@google: 917472

Security

Twothy uses AES to encrypt your accounts. It doesn't cache any passwords and requires password to add account and generate OTP.

Backup

I use google drive to backup my 2FA accounts by configuring twothy to save accounts inside Google Drive folder. You are free to use your favourite backup service to achieve something similar

Built With

  • Go
  • Glide - Dependency Management
  • HomeDir - Used to get User's home directory
  • Crypto - Used to get password from terminal securely

Contributing

PRs, Issues, and Feedback are very welcome and appreciated.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the Unlicense - see the LICENSE file for details

twothy's People

Contributors

vedhavyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

twothy's Issues

FEATURE: Support secret-tool

It'd be nice if twothy were able to pull the password from secret-tool, or some other password caching, so that the password doesn't have to be entered every time.

FEATURE: Export secrets

Occasionally, one will want to export a secret into another tool (e.g. andOTP, keepassxc), and for that we need access to the secret. A command in twothy for exporting a secret would be useful -- the inverse of add. E.g.,

twothy showsecret [issuer] [label]: show the secret key for an account

validatePassword pads password with =

I'm not sure what the usual best practice is, but I'd expect that you use a hash of the password if you want the input to AES to be a fixed length.

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.