From 27224924f63713eb9235bc404198d70831c2ae7e Mon Sep 17 00:00:00 2001 From: Jakob Moser <moser@cl.uni-heidelberg.de> Date: Mon, 1 Jul 2024 15:16:52 +0200 Subject: [PATCH] Add short README, enhance .gitignore --- .gitignore | 1 + README.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index bee8a64..82adb58 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +venv diff --git a/README.md b/README.md new file mode 100644 index 0000000..e2400c1 --- /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 -- GitLab