{"id":13467097,"url":"https://github.com/replydev/cotp","last_synced_at":"2025-05-15T04:03:34.119Z","repository":{"id":37849269,"uuid":"323185066","full_name":"replydev/cotp","owner":"replydev","description":"Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.","archived":false,"fork":false,"pushed_at":"2025-04-26T23:17:23.000Z","size":14980,"stargazers_count":293,"open_issues_count":1,"forks_count":24,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-26T23:25:01.439Z","etag":null,"topics":["authentication","authy","clipboard","commandline","google-authenticator","hotp","linux","rust","totp","totp-codes","tui-rs","windows","xchacha20-poly1305"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replydev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-20T23:26:23.000Z","updated_at":"2025-04-26T23:17:26.000Z","dependencies_parsed_at":"2024-02-25T18:34:26.555Z","dependency_job_id":"545a2b69-f32f-4653-9cac-e48cbd919854","html_url":"https://github.com/replydev/cotp","commit_stats":{"total_commits":486,"total_committers":10,"mean_commits":48.6,"dds":0.5720164609053497,"last_synced_commit":"22db6656ebeed4a0a07ace3b214cf89c83df6025"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replydev%2Fcotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replydev%2Fcotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replydev%2Fcotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replydev%2Fcotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replydev","download_url":"https://codeload.github.com/replydev/cotp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authy","clipboard","commandline","google-authenticator","hotp","linux","rust","totp","totp-codes","tui-rs","windows","xchacha20-poly1305"],"created_at":"2024-07-31T15:00:53.086Z","updated_at":"2025-05-15T04:03:34.082Z","avatar_url":"https://github.com/replydev.png","language":"Rust","readme":"# cotp - command line TOTP/HOTP authenticator\n\n[![Actions Status](https://github.com/replydev/cotp/workflows/Build/badge.svg)](https://github.com/replydev/cotp/actions)\n[![crates.io](https://img.shields.io/crates/v/cotp)](https://crates.io/crates/cotp) \n[![Downloads](https://img.shields.io/crates/d/cotp)](https://crates.io/crates/cotp)\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/cotp.svg)](https://repology.org/project/cotp/versions)\n\nI believe that security is of paramount importance, especially in this digital world. I created cotp because I needed a\nminimalist, secure, desktop accessible software to manage my two-factor authentication codes.\n\n# Overview\n\n## Interface\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"/img/cotp_demo.gif?raw=true\"/\u003e\u003c/p\u003e\n\nType `i` to get some instruction. Otherwise just enter `cotp --help`.\nIn the first run you will be prompted to insert a password to initialize the database.\n\n## TL;DR\n\n```bash\n# Display all the OTP codes in the interactive dashboard\ncotp # select any code with arrow keys, press enter to copy into the clipboard, even in an SSH remote shell\n\n# Add a new TOTP code from a BASE32 secret key\ncotp add --label myaccount@gmail.com --issuer Google\n\n# Add a new HOTP code with custom algorithm, digits and counter\ncotp add --label example --type hotp --algorithm SHA256 --digits 8 --counter 10\n\n# Edit the digits of the 4th OTP code\ncotp edit --index 4 --digits 8\n\n# List all the codes in JSON format passing password through stdin\necho \"mysecretpassword\" | cotp --password-stdin list --json\n\n# Extract the first matching OTP code with \"google\" issuer and copy it into the clipboard\ncotp extract --issuer google --copy-clipboard\n\n# Import an encrypted Aegis Database backup\ncotp import --path my_db.json --aegis-encrypted\n\n# Export the cotp database\ncotp export\n```\n\n## Compatibility\n\ncotp 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.\n\nLatest releases also include support for **Steam**, **Yandex**, **MOTP** codes.\n\n## Encryption\n\nThis program relies on only one database file encrypted\nwith [XChaCha20Poly1305](https://docs.rs/chacha20poly1305/latest/chacha20poly1305/) authenticated encryption\nand [Argon2id](https://en.wikipedia.org/wiki/Argon2) for key derivation.\n\nIt also uses [AES-GCM](https://docs.rs/aes-gcm/latest/aes_gcm/) to import from encrypted Aegis backups.\n\n\n## Cross Platform\n\ncotp should be easily compiled on the most used platforms, but it is mostly tested on Linux, Windows and macOS.\n\n# Install\n\n## Arch Linux / Manjaro / Debian / Ubuntu / NixOS / others...\n\ncotp 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.\nI will try to push to more repositories over time.\n\nOtherwise you have other options as explained in the next paragraph.\n\n## Other linux distributions and \\*nix\n\nBefore beginning check that you have the required build dependencies to use the rust compiler.\n\nYou need to install the **libxcb-devel** dependency, needed for clipboard coping in X11:\n\n- Debian based: `sudo apt install libxcb1-dev libx11-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev xclip`\n- Fedora / RHEL based: `sudo dnf install libX11-devel`\n- Void Linux `sudo xbps-install -S libxcb-devel`\n\n## macOS\n\n```\nbrew install cotp\n```\n\n## Windows\n\nBuilding is supported with both `x86_64-pc-windows-gnu` and `x86_64-pc-windows-msvc` toolchains.\n\nIf you want to use `x86_64-pc-windows-msvc` you will need to install\nthe [Visual C++ 2019 Build Tools](https://visualstudio.microsoft.com/it/thank-you-downloading-visual-studio/?sku=BuildTools\u0026rel=16)\n\nOnce you have the rust toolchain installed just run `cargo install cotp`.\n\n### Use the crates.io repository\n\nJust type `cargo install cotp` and wait for the installation.\n\n### Clone the GitHub repository and manually install\n\nYou can build cotp using these commands:\n\n```\ngit clone https://github.com/replydev/cotp.git\ncargo install --path cotp/\n```\n\n# Migration from other apps\n\ncotp supports TOTP codes migration from various apps.\nSome needs to be converted using simple python script you can find listed in the table below.\n\n| App                                                                                                          | How to fetch backup                                                                                                                                                 | Needs conversion                                                          | cotp argument               |\n|--------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|-----------------------------|\n| [andOTP](https://github.com/andOTP/andOTP)                                                                   | Make a backup using the app itself.                                                                                                                                 | No                                                                        | `--andotp`                  |\n| [Aegis](https://github.com/beemdevelopment/Aegis)                                                            | Make a backup using the app itself.                                                                                                                                 | No                                                                        | `--aegis`                   |\n| [Aegis](https://github.com/beemdevelopment/Aegis) (encrypted)                                                | Make an encrypted backup using the app itself.                                                                                                                      | No                                                                        | `--aegis-encrypted`         |\n| [Authy](https://authy.com/)                                                                                  | Obtain `/data/data/com.authy.authy/shared_prefs/com.authy.storage.tokens.authenticator.xml` from your phone.                                                        | [Yes](https://github.com/replydev/cotp/blob/master/converters/authy.py)   | `--authy`                   |\n| [Authy](https://authy.com/) (2nd method)                                                                     | Follow this guide: https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93.                                                                              | No                                                                        | `--authy-exported`          |\n| [cotp](https://github.com/replydev/cotp)                                                                     | Export your database using `cotp export`.                                                                                                                           | No                                                                        | `--cotp`                    |\n| [FreeOTP](https://freeotp.github.io/)                                                                        | Obtain `/data/data/org.fedorahosted.freeotp/shared_prefs/tokens.xml` from your phone.                                                                               | [Yes](https://github.com/replydev/cotp/blob/master/converters/freeotp.py) | `--freeotp`                 |\n| [FreeOTP+](https://github.com/helloworld1/FreeOTPPlus)                                                       | Make a backup using the app itself.                                                                                                                                 | No                                                                        | `--freeotp-plus`            |\n| [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) | Obtain `/data/data/com.google.android.apps.authenticator2/databases/databases` from your phone                                                                      | [Yes](https://github.com/replydev/cotp/blob/master/converters/gauth.py)   | `--google-authenticator`    |\n| [Microsoft Authenticator](https://play.google.com/store/apps/details?id=com.azure.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](https://github.com/replydev/cotp/blob/master/converters/mauth.py)   | `--microsoft-authenticator` |\n| [OTP URI list](https://docs.yubico.com/yesdk/users-manual/application-oath/uri-string-format.html)           | 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`                 |\n\n## How to convert\n\nOnce you got the correct files run the right python script located in the **converters/** folder in this source code.\n\n**Example:**\n`python authy.py path/to/database.xml converted.json`\n\nIt will convert the database in a json format readable by cotp.\n\nTo terminate the import:\n`cotp import --authy --path path/to/converted_database.json`\n\n# Configuration\n\nBy 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.\nThe first can be configured in shell configuration files, the second in package managers where the configuration of environment variables is not allowed, like Scoop.\n\nThese are examples of how to do this in bash:\n```bash\n$ COTP_DB_PATH=/home/user/.local/custom-folder/db.cotp cotp\n```\nor\n```bash\n$ cotp --database-path /home/user/.local/custom-folder/db.cotp\n```\n\n# Planned features\n\nCurrently, there is not any planned feature. If you need something new that could improve the software feel free to open\nan issue.\n\n# Contribution\n\nI created this project for my own needs, but I would be happy if this little program is useful to someone else, and I\ngratefully accept any pull requests.\n","funding_links":[],"categories":["Applications","Rust","windows","💻 Apps","\u003ca name=\"security\"\u003e\u003c/a\u003eSecurity and encryption"],"sub_categories":["Security tools","🌌 Other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplydev%2Fcotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplydev%2Fcotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplydev%2Fcotp/lists"}