百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

cotp

> 安全
开源

带有导入功能的加密命令行 TOTP/HOTP 身份验证应用程序。

383 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

带有导入功能的加密命令行 TOTP/HOTP 身份验证应用程序。

cotp - command line TOTP/HOTP authenticator

I believe that security is of paramount importance, especially in this digital world. I created cotp because I needed a minimalist, secure, desktop accessible software to manage my two-factor authentication codes.

Overview

Interface

Type i to get some instruction. Otherwise just enter cotp --help. In the first run you will be prompted to insert a password to initialize the database.

TL;DR

…

Compatibility

cotp can generate both TOTP and HOTP codes, compliant with rfc6238 and rfc4226 specifications. Also, it is possible to customize settings like HMAC algorithm and digits, to provide compatibility to other two-factor authentication systems.

Latest releases also include support for Steam, Yandex, MOTP codes.

Encryption

This program relies on only one database file encrypted with XChaCha20Poly1305 authenticated encryption and Argon2id for key derivation.

It also uses AES-GCM to import from encrypted Aegis backups.

Cross Platform

cotp should be easily compiled on the most used platforms, but it is mostly tested on Linux, Windows and macOS.

Install

Arch Linux / Manjaro / Debian / Ubuntu / NixOS / others...

cotp is distributed in some of the mayor Linux distro repositories. Please check the repology badge at the top to know if your distribution already provides a package. I will try to push to more repositories over time.

Otherwise you have other options as explained in the next paragraph.

Other linux distributions and *nix

Before beginning check that you have the required build dependencies to use the rust compiler.

You need to install the libxcb-devel dependency, needed for clipboard coping in X11:

  • Debian based: sudo apt install libxcb1-dev libx11-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev xclip
  • Fedora / RHEL based: sudo dnf install libX11-devel
  • Void Linux sudo xbps-install -S libxcb-devel

macOS

bash
brew install cotp

Windows

Building is supported with both x86_64-pc-windows-gnu and x86_64-pc-windows-msvc toolchains.

If you want to use x86_64-pc-windows-msvc you will need to install the Visual C++ 2019 Build Tools

Once you have the rust toolchain installed just run cargo install cotp.

Use the crates.io repository

Just type cargo install cotp and wait for the installation.

Clone the GitHub repository and manually install

You can build cotp using these commands:

bash
git clone https://github.com/replydev/cotp.git
cargo install --path cotp/

Migration from other apps

cotp supports TOTP codes migration from various apps. Some needs to be converted using simple python script you can find listed in the table below.

App How to fetch backup Needs conversion cotp argument
andOTP Make a backup using the app itself. No --andotp
Aegis Make a backup using the app itself. No --aegis
Aegis (encrypted) Make an encrypted backup using the app itself. No --aegis-encrypted
Authy Obtain /data/data/com.authy.authy/shared_prefs/com.authy.storage.tokens.authenticator.xml from your phone. Yes --authy
Authy (2nd method) Follow this guide: https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93. No --authy-exported
cotp Export your database using cotp export. No --cotp
FreeOTP Obtain /data/data/org.fedorahosted.freeotp/shared_prefs/tokens.xml from your phone. Yes --freeotp
FreeOTP+ Make a backup using the app itself. No --freeotp-plus
Google Authenticator In the app open the menu, choose "Transfer accounts" > "Export accounts", select the accounts and let it generate the QR code(s). Scan each QR code with any scanner and save the resulting otpauth-migration://... URI(s), one per line, into a text file. No --google-authenticator
Microsoft Authenticator Obtain /data/data/com.azure.authenticator/databases/PhoneFactor from your phone. Take also PhoneFactor-wal, PhoneFactor-shm if they exist in the same folder. Yes --microsoft-authenticator
OTP URI list Create a JSON file which contains a items property. It will contains a string array where each element is an OTP URI. No --otp-uri

How to convert

Once you got the correct files run the right python script located in the converters/ folder in this source code.

Example: python authy.py path/to/database.xml converted.json

It will convert the database in a json format readable by cotp.

To terminate the import: cotp import --authy --path path/to/converted_database.json

Configuration

By default database is located in $HOME/.cotp/db.cotp. If you want to use a different path, you can use COTP_DB_PATH environment variable or use the --database-path argument. The first can be configured in shell configuration files, the second in package managers where the configuration of environment variables is not allowed, like Scoop.

These are examples of how to do this in bash:

bash
$ COTP_DB_PATH=/home/user/.local/custom-folder/db.cotp cotp

or

bash
$ cotp --database-path /home/user/.local/custom-folder/db.cotp

Planned features

Currently, there is not any planned feature. If you need something new that could improve the software feel free to open an issue.

Contribution

I created this project for my own needs, but I would be happy if this little program is useful to someone else, and I gratefully accept any pull requests.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustauthenticationauthyclipboardcommandline

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类安全
定价开源

> 相关工具

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.