Git Product home page Git Product logo

rustotpony's Introduction

๐Ÿด RusTOTPony

crates.io build

CLI manager of time-based one-time password generators. It is a desktop alternative to Google Authenticator.

Installation

Arch Linux

Packages, available in AUR:

Other

Grab an appropriate binary from the latest release and put it in a place of your choice. If you're on the *nix system, don't forget to set proper permissions: chmod +x totp.

Build manually

From crates.io

Make sure you have $HOME/.cargo/bin in your $PATH.

cargo install rustotpony

From source

  1. Clone this repo
  2. Run cargo install from the inside of the repo directory
  3. Keep calm and wait for the compilation

Probably, you will need gcc (Linux) or clang (Mac OS) to compile dependencies.

Usage

$ totp help
๐Ÿด RusTOTPony 0.3.2

Manager of one-time password generators

Usage: totp [COMMAND]
Commands:
  dash       Show realtime dashboard with all generators
  list       List all generators
  add        Add a new generator
  delete     Delete a generator
  rename     Rename a generator
  eradicate  Delete all generators
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help information
  -V, --version  Print version information

Choose your password wisely

At the very first run, totp asks for a password for a new database. It's located at $HOME/.rustotpony/db.json (don't be confused by json extension it's a binary file in fact). If you forget the password or want to change it, you have to remove $HOME/.rustotpony directory. It's not convenient, but I'm going to improve usability and add a command for changing the password.

Basic scenario

  1. Retrieve a secret key from your TOTP provider (it must be encoded with base32, for example, GEZDGMZSGE2TKCQ=)

    $ # Creating a fake secret key for demo purposes
    $ echo 123321555 | base32
    GEZDGMZSGE2TKNIK
  2. Add new generator with totp add <NAME> (you will be asked for a secret and a password)

    $ # Adding a new TOTP generator
    $ totp add demo
    Enter your secret code:
    Enter your database pass:
    New application created: demo

    If it's not the first run, you'll be asked for a password twice: for opening the database and for saving it.

  3. Use totp list to check your secrets

    $ # Listing all secrets in the database
    $ totp list
    Enter your database pass:
    +------+------------------+----------+
    | name | key              | username |
    +------+------------------+----------+
    | demo | GEZDGMZSGE2TKNIK |          |
    +------+------------------+----------+
  4. Use totp dash or just totp for real-time dashboard

    $ # Display real-time dashboard with all generators
    $ totp
    Enter your database pass:
    Welcome to RusTOTPony realtime dashboard! Press ^C to quit.
    [=============================================               ]
    009216 demo
  5. After hitting ^C it'll clean up the dashboard

    $ totp
    Enter your database pass:
    I won't tell anyone about this ๐Ÿคซ

TODO

  • command completion
  • database password caching
  • tests
  • refactor show and show-all commands

License

Licensed under the MIT License.

rustotpony's People

Contributors

zebradil avatar renovate[bot] avatar zebradil-bot avatar dependabot[bot] avatar

Stargazers

wood avatar  avatar Tamas Jantvik avatar Corey Rusko avatar Daniel Phan avatar Molasses avatar Dominic Hock avatar Alvaro Tinoco avatar alberto__segura avatar  avatar Shabbir Hasan avatar Jamal .P .T Nesta avatar Alexander ADAM avatar Thallysson Klein avatar Sebastian Schlatow avatar Christoph Grabo avatar David Wooldridge avatar  avatar Thomas Buckley-Houston avatar Shane Snover avatar tg-z avatar Ye Wang avatar Majed Abualsaud avatar Kamron Bhavnagri avatar Basel Ajarmah avatar Sanhaji Omar avatar Sova avatar  avatar Rick Richardson avatar  avatar

Watchers

James Cloos avatar  avatar jay avatar Kostas Georgiou avatar  avatar

rustotpony's Issues

Rework CI

actions/create-release is not maintained, migrate to automatic releases with cycjimmy/semantic-release-action

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • base32 0.4.0
  • clap ^4.5.1
  • keyring ^2.3.2
  • totp-lite 2.0.1
  • rand ^0.8.5
  • rpassword ^7.3.1
  • rust-crypto 0.2.36
  • serde 1.0.197
  • serde_derive 1.0.197
  • serde_json 1.0.114
  • dirs ^5.0.1
  • ctrlc 3.4
github-actions
.github/workflows/flow-push-main.yaml
  • actions-rust-lang/setup-rust-toolchain v1
  • actions/checkout v4
  • actions/cache v4
  • actions/cache v4
  • actions-rust-lang/setup-rust-toolchain v1
  • actions/checkout v4
  • actions/cache v4
  • actions/cache v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • crazy-max/ghaction-import-gpg v6
  • actions/download-artifact v4
  • cycjimmy/semantic-release-action v3

  • Check this box to trigger a request for Renovate to run again on this repository

Support importing accounts from google authenticator export url

Support importing accounts from the URL exported by Google Authenticator export functionality.
The export generates a QR code that contains within an URL like this:

otpauth-migration://offline?data=urlencoded-base64-encoded-protobuff-binary-data

The protobuff protocol specifing the content is this:

syntax = "proto3";

// Copied from: https://github.com/beemdevelopment/Aegis/blob/master/app/src/main/proto/google_auth.proto

message MigrationPayload {
  enum Algorithm {
    ALGO_INVALID = 0;
    ALGO_SHA1 = 1;
  }

  enum OtpType {
    OTP_INVALID = 0;
    OTP_HOTP = 1;
    OTP_TOTP = 2;
  }

  message OtpParameters {
    bytes secret = 1;
    string name = 2;
    string issuer = 3;
    Algorithm algorithm = 4;
    int32 digits = 5;
    OtpType type = 6;
    int64 counter = 7;
  }

  repeated OtpParameters otp_parameters = 1;
  int32 version = 2;
  int32 batch_size = 3;
  int32 batch_index = 4;
  int32 batch_id = 5;
}

It would be great if there were an import-otpauth-migration subcommand which would take this kind of url as input and then import the accounts from it.

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.