Crates.io | gotp |
lib.rs | gotp |
version | 0.1.2 |
source | src |
created_at | 2018-09-13 07:31:02.659045 |
updated_at | 2018-11-12 21:19:55.868895 |
description | Generate totp codes for various accounts which are saved and AES encrypted. |
homepage | https://github.com/Skarlso/totp |
repository | https://github.com/Skarlso/totp |
max_upload_size | |
id | 84497 |
size | 23,097 |
A cli TOTP token generator based on RFC-6238.
This CLI never stores a password. It always asks for one. The password is used to manage multiple accounts and tokens via an AES encrypted account file located next to the binary.
❯ totp help
totp 1.0
Gergely Brautigam
TOTP Token generator on the command line with AES encrypted account handling.
USAGE:
totp [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
add Adds a new account with a TOTP token.
delete Delete a given account.
generate Generate a new token for a given account.
help Prints this message or the help of the given subcommand(s)
First, create an account by using the provided BASE32 encoded TOTP identifier.
❯ totp add
account:
gmail_main
token:
MFZWIZQASDFFSFDSIJAAA=
Password:
Once this is done, you are ready to use the generator to generate a 6 digit token which changes every 30 seconds.
❯ totp generate -a gmail_main
Password:
364898
You can create an alias for that saying something like gmail_main_token
.
On linux, this also adds the ability to directly pipe the resulting token to clipboard. Ready to be pasted into something else.
gmail_main_token|pbcopy
Password:
Then simply press {CTRL,CMD}+C and voila...
452987
If you are like me and have many tokens for many accounts, it's tedious to constantly enter the account names.
But that's what aliases are for.
Save this into your bash.rc or zshrc or whatever, which will create aliases like gg
and wgg
for short-codes.
gotp-generate() {
gotp generate -a $1
}
gg() {
gotp-generate personal.gmail
}
wgg() {
gotp-generate work.gmail
}
This generator is in full compliance to the RFC described here: RFC-6238. Note: With the expection that right now times, and methods are not configurable. That is in the ROADMAP.
I know, they are missing. And in the works. I'm still learning Rust.
Now there are unit tests!
Are welcomed.