A simple Python script that generates Time-based One-time Password and copy it to clipboard.
Reading the secret can be done both by reading the QR code or by entering a text string.
The secret will be stored in encryption.
- Run
to get the libraries required.
pip install pyotp pip install keyring pip install pyzbar
- Get your QR code or secret for your 2FA. (Please google how to get your QR code or secret!)
- If you got your QR code, save the QR code you got in the same directory with the name
qr.png
. - Run
in a shell (or execute
python main.py
copy_otp.bat
if you are using Windows). - The first time you run the script, if the image file of the QR code exists, the secret will be read from the QR code and the image file will be deleted. If not, you will be asked to enter the secret.
- Time-based One-time Password will be copied to the clipboard.