cloak
A Command Line OTP (One Time Password) Authenticator application written in Rust that generates time-based and counter-based OTP codes.
Motivation
- Why you shouldn’t scan two-factor authentication QR codes!
- 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:
-
Binaries
You can download the binaries here. Make sure to put the path to the binary into your
PATH
. -
Crates.io
Once you've installed Rust, install
cloak
by typing the following in the terminal:This will download and compile
cloak
. After this is finished, add the Cargo bin directory to yourPATH
.
Usage
The sub-commands included in cloak
are as follows:
)
To view the help of any of the subcommands below, add -h
or --help
, e.g. cloak add -h
.
-
cloak add <account> <key>
This will add a new account. You will need to provide the name of the account as well as valid base32 encoded key. Example:
-
cloak view <account>
This will print the TOTP/HOTP of the account you want to view. Example:
-
cloak list
This prints all the accounts with their respective TOTP/HOTP codes. Example:
-
cloak delete <account>
This will delete an account. Once deleted, you cannot view the OTP codes for the account. Example:
-
cloak recovery_codes <account>
This will open a file, using your preferred editor, to either save new recovery codes or view existing recovery codes.
Contributions
If you want to contribute to cloak
you will have to clone the repository on your
local machine:
To build, cd
into cloak/
and run:
To run tests: