Skip to content

Granddave/aegis-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci dependency status License: GPL v3

Aegis 2FA Authenticator CLI

This is a CLI tool for generating OTP codes from a backup vault from the Android app Aegis Authenticator.

Features

  • Decryption of the 256 bit AES-GCM encrypted vault 🔓
  • Fuzzy selection 🔍
  • TOTP generation 🕒
  • Time left indication ⏳
  • Clipboard support 📋
  • JSON output to stdout 📜

Getting Started with Aegis-rs

Installation

The easiest way to install Aegis-rs is by using cargo:

$ cargo install --git https://github.com/Granddave/aegis-rs --tag latest

Launching Aegis-rs with a Backup File

To start Aegis-rs, simply pass the path to your backup file as an argument and enter password. For example:

$ aegis-rs ~/Documents/aegis-backup-20230512-193110.json
? Insert Aegis Password › ********

Searching for an Entry

Aegis-rs supports fuzzy finding for quickly locating entries. Type a part of the entry's name to filter the list. For instance:

› tw
❯ Twitter (@johndoe)
  Twitch (johndoe)
  TeamViewer (johndoe@protonmail.com)
  Bitwarden (johndoe@protonmail.com)

Generating an OTP

Aegis-rs allows you to read the OTP directly in the terminal or paste it using the integrated clipboard support. OTPs are regenerated automatically upon expiration. Here the OTP is displayed, including its remaining validity:

· Twitter (@johndoe)
121921 (28s left)

Ways to unlock the Vault

To unlock the Aegis vault Aegis-rs supports the following methods:

  1. Password: The password can be passed as an argument or set as an environment variable.
    • Environment variable: AEGIS_PASSWORD
    • Argument: --password <PASSWORD>
    • Example: aegis-rs --password hunter2 vault.json
  2. Password file: A file containing the password to unlock the vault.
    • Environment variable: AEGIS_PASSWORD_FILE
    • Argument: --password-file <PASSWORD_FILE>
    • Example: aegis-rs --password-file /path/to/password-file vault.json
  3. Password prompt: If no password is provided, Aegis-rs will prompt you to enter the password.

Extra flags

  • --issuer <ISSUER>: Filter entries by entry issuer.
  • --name <NAME>: Filter entries by entry name.
  • --json: Output the calculated OTPs as JSON.

TODO

  • Add password file feature
  • Add countdown timer and refresh TOTP code after timeout
  • Display digits in groups
  • Add TOTP to clipboard
  • Add CI

Project history

This project has been divided into a binary (this repo) and a vault utility crate so that other projects can utilize the parsing and OTP generation functionalities as well.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.