Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evansmurithi/cloak
A Command Line OTP Authenticator application.
https://github.com/evansmurithi/cloak
otp rust terminal-based
Last synced: 3 months ago
JSON representation
A Command Line OTP Authenticator application.
- Host: GitHub
- URL: https://github.com/evansmurithi/cloak
- Owner: evansmurithi
- License: mit
- Created: 2018-07-13T19:50:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-09T02:58:46.000Z (almost 2 years ago)
- Last Synced: 2024-09-19T12:48:55.505Z (4 months ago)
- Topics: otp, rust, terminal-based
- Language: Rust
- Homepage:
- Size: 309 KB
- Stars: 285
- Watchers: 5
- Forks: 16
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - evansmurithi/cloak - ci.com/evansmurithi/cloak.svg?branch=master">](https://travis-ci.com/evansmurithi/cloak) [<img src="https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true">](https://ci.appveyor.com/project/evansmurithi/cloak) (Applications / Utilities)
- awesome-rust - evansmurithi/cloak
- awesome-rust-cn - evansmurithi/cloak - 一个命令行OTP(一次性密码)验证器应用程序。 (应用程序 Applications / 公用事业公司 Utilities)
- awesome-rust-zh - evansmurithi/cloak - 命令行 OTP(一次性密码)身份验证器应用程序。[<img src="https://api.travis-ci.com/evansmurithi/cloak.svg?branch=master">](https://travis-ci.com/evansmurithi/cloak) [<img src="https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true">](https://ci.appveyor.com/project/evansmurithi/cloak) (应用 / 实用)
- awesome-rust - evansmurithi/cloak - A Command Line OTP (One Time Password) Authenticator application. ![CI](https://github.com/evansmurithi/cloak/workflows/CI/badge.svg) [![build badge](https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true)](https://ci.appveyor.com/project/evansmurithi/cloak) (Applications / Utilities)
- awesome-rust-cn - evansmurithi/cloak - ci.com/evansmurithi/cloak.svg?branch=master">](https://travis-ci.com/evansmurithi/cloak) [<img src="https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true">](https://ci.appveyor.com/project/evansmurithi/cloak) (应用 / Utilities)
- awesome-rust - evansmurithi/cloak - ci.com/evansmurithi/cloak.svg?branch=master">](https://travis-ci.com/evansmurithi/cloak) [<img src="https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true">](https://ci.appveyor.com/project/evansmurithi/cloak) (应用 Applications / 公用事业 Utilities)
- fucking-awesome-rust - evansmurithi/cloak - A Command Line OTP (One Time Password) Authenticator application. ![CI](https://github.com/evansmurithi/cloak/workflows/CI/badge.svg) [![build badge](https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true)](https://ci.appveyor.com/project/evansmurithi/cloak) (Applications / Utilities)
- fucking-awesome-rust - evansmurithi/cloak - A Command Line OTP (One Time Password) Authenticator application. ![CI](https://github.com/evansmurithi/cloak/workflows/CI/badge.svg) [![build badge](https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689/branch/master?svg=true)](https://ci.appveyor.com/project/evansmurithi/cloak) (Applications / Utilities)
README
# cloak
A Command Line OTP (One Time Password) Authenticator application written in Rust that generates
time-based and counter-based OTP codes.![CI](https://github.com/evansmurithi/cloak/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/evansmurithi/cloak/branch/master/graph/badge.svg?token=Y72C1MM1E8)](https://codecov.io/gh/evansmurithi/cloak)
![License](https://img.shields.io/crates/l/cloak.svg)
[![Crates.io version](https://img.shields.io/crates/v/cloak.svg)](https://crates.io/crates/cloak)## Motivation
- [Why you shouldn’t scan two-factor authentication QR codes!](https://medium.com/crypto-punks/why-you-shouldnt-scan-two-factor-authentication-qr-codes-e2a44876a524)
- As a means of learning the Rust programming language.
- Easier to copy the OTP code from my terminal to the login form, rather than from
my phone to my laptop.## Example
## Installation
To install `cloak`, you can do either of the following:
1. **Binaries**
You can download the binaries [here](https://github.com/evansmurithi/cloak/releases).
Make sure to put the path to the binary into your `PATH`.Alternatively, you can install `cloak` via the [scoop package manager](https://scoop.sh) with the following command:
```powershell
scoop install cloak
```2. **Crates.io**
Once you've installed Rust, install `cloak` by typing the following in the terminal:
```bash
cargo install cloak
```This will download and compile `cloak`. After this is finished, add the Cargo
bin directory to your `PATH`.## Usage
The sub-commands included in `cloak` are as follows:
```bash
$ cloak -h
cloak 0.1.0
Evans Murithi
A Command Line OTP Authenticator application.USAGE:
cloak [SUBCOMMAND]FLAGS:
-h, --help Prints help information
-V, --version Prints version informationSUBCOMMANDS:
add Add a new account
delete Delete an account
help Prints this message or the help of the given subcommand(s)
list List OTP for all accounts
view View the OTP for an account
```To view the help of any of the subcommands below, add `-h` or `--help`, e.g. `cloak add -h`.
- `cloak add `
This will add a new account. You will need to provide the name of the account
as well as valid base32 encoded key. Example:```bash
$ cloak add github 4AZJFQFIGYM2KMTOO72I6FAOZ6ZFWJR6
```- `cloak view `
This will print the TOTP/HOTP of the account you want to view. Example:
```bash
$ cloak view github
123456
```- `cloak list`
This prints all the accounts with their respective TOTP/HOTP codes. Example:
```bash
$ cloak list
Account: github
TOTP: 607091Account: gitlab
TOTP: 325414
```- `cloak delete `
This will delete an account. Once deleted, you cannot view the OTP codes for
the account. Example:```bash
$ cloak delete github
Account successfully deleted
$ cloak view github
Account with the name 'github' does not exist. Consider adding it.
```## Customization
By default `cloak` stores your accounts and recovery codes inside a `.cloak/`
directory found inside your `$HOME` folder if you are on Linux or macOS, or
inside your user profile folder if you are on Windows.To alter this, you can use the `CLOAK_ACCOUNTS_DIR` environment variable to
point `cloak` to the directory to use for storing your accounts and recovery
codes:```bash
export CLOAK_ACCOUNTS_DIR='/save/accounts/here/' # absolute path
```## Contributions
If you want to contribute to `cloak` you will have to clone the repository on your
local machine:```bash
$ git clone https://github.com/evansmurithi/cloak.git
```To build, `cd` into `cloak/` and run:
```bash
$ cargo build
```To run tests:
```bash
$ cargo test
```