#totp #authenticator #2fa #tui #security

app tufa-rs

A terminal-based TOTP authenticator

9 releases (4 breaking)

Uses new Rust 2024

0.5.10 May 1, 2026
0.4.9 Apr 27, 2026
0.3.5 Mar 31, 2026
0.2.1 Mar 28, 2026
0.1.0 Mar 27, 2026

#191 in Authentication

MIT license

96KB
2K SLoC

tufa logo

tufa-rs

A terminal-based TOTP authenticator written in Rust.

crates.io MIT License Status Rust

Warning: This project is still in development.


Overview

tufa is a fast, secure, offline TOTP authenticator for the terminal. Secrets live in encrypted vaults on your local machine.


Features

  • TOTP code generation
  • Multiple password-protected vaults
  • AES-256-GCM encryption with Argon2id key derivation
  • Interactive TUI and CLI modes
  • Import from otpauth:// and Google Authenticator migration format
  • Export to otpauth:// URIs
  • Clipboard support (wl-copy, xclip, xsel, pbcopy)

Installation

From crates.io

cargo install tufa-rs

From source

git clone https://github.com/gnoega/tufa
cd tufa-rs
cargo build --release
# binary at: target/release/tufa

Usage

Interactive TUI

Launch without arguments to open the interactive interface:

tufa

Navigate vaults with arrow keys or j/k, press Enter to open. Select an account and press Enter to copy the current TOTP code to your clipboard.

CLI Mode

tufa show <account>      # Display the current TOTP code
tufa list [vault]        # List all accounts in a vault
tufa add <name> <secret> # Add a new TOTP account
tufa del <name>          # Delete a TOTP account
tufa import <uri>        # Import from an otpauth:// URI
tufa export [account]    # Export accounts as otpauth:// URIs

Account names use the format <issuer>:<name> or <vault>.<issuer>:<name>.


Security

Vaults are encrypted with AES-256-GCM using a key derived from your password via Argon2id. Each vault file includes a unique random salt and nonce, ensuring identical inputs produce different ciphertext.

All data stays on your machine

Vaults are stored in your system's config directory:

Platform Path
Linux ~/.config/tufa/
macOS ~/Library/Application Support/tufa/
Windows %APPDATA%\tufa\

Each vault is a separate .2fa file.


License

MIT

Dependencies

~20–36MB
~553K SLoC