diff --git a/.gitignore b/.gitignore index bee8a64b79a99590d5303307144172cfe824fbf7..82adb58b4d6486436545d1dff4e4a5bc59e17bdd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +venv diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e2400c15f95309a1998126883455b573704d3140 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# 2FA + +This is only a quick demo on how you could possible generate a second factor in form of a one-time-password using Python. + +If you want to manage all your second factors in one place, this tool is not for you. + +## Installation + +```bash +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +## Enrollment + +Launch a Python shell, e.g., using: + +```bash +source venv/bin/activate +python3 +``` + +Within the shell, type: + +```python +from main import enroll_token +enroll_token("otpauth://totp/...") # replace this with the URL you've gotten from the 2FA enrollment system +``` + +This will only store the token locally in the secret storage, without any validation whatsoever. + +## Get token + +```bash +source venv/bin/activate +./main.py +``` \ No newline at end of file