Skip to content
/ 2fa Public

Two-factor authentication code generator compatible with andOTP

Notifications You must be signed in to change notification settings

hejmsdz/2fa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2fa

Two-factor authentication code generator compatible with andOTP.

Getting started

  1. Download and compile the code:
git clone https://github.com/hejmsdz/2fa.git
cd 2fa
go build
mv ./2fa ~/.bin/2fa # move somewhere in your $PATH for easy access
  1. Run andOTP on your phone, export an encrypted backup and store it at ~/.2fa/otp_accounts.json.aes.
  2. Open Keychain Access and add your backup password as 2FA

Usage

To list your accounts, simply run 2fa.

➜ 2fa
Available accounts:
* Google
* Bitwarden
* GitHub
* Firefox

To generate a 2FA code and copy it to clipboard, run 2fa [account]. You can use an unambiguous fragment instead of the full name and matching is case-insensitive.

➜ 2fa gith
2FA code for GitHub: 539702
(copied to clipboard)

Limitations

  • Only timed one-time passwords (TOTP) with SHA-1 hashing are supported.
  • Tested on macOS Big Sur. Keychain may not work on other platforms.

About

Two-factor authentication code generator compatible with andOTP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages