# 2fa

> Self-hosted, open-source TOTP/HOTP key manager that runs as a Cloudflare Worker: AES-GCM encrypted storage, QR import, PWA offline use, backups to WebDAV/S3/OneDrive.

- **Category:** Authentication
- **Licence:** MIT
- **Latest version:** v1.13.1
- **Open source:** oss
- **Languages:** JavaScript
- **Platforms:** Cloudflare Workers
- **Tags:** Backup, Security, Encryption, 2FA, Webdav, Serverless, Pwa, TOTP, Otp, Onedrive, Browser Extension, Javascript, S3, Google drive, Self Hosted, Cloudflare Workers, Chrome Extension, Firefox extension, Hotp, Qrcode, Two Factor Authentication, Two Factor, Authenticator, Autofill

## Description

This project is a two-factor authentication key manager you publish as your own Cloudflare Worker, so the whole app runs serverlessly on the free Workers tier instead of a VPS. It generates TOTP and HOTP codes locally in the browser, and keys can be added by scanning a QR code with the camera, uploading, pasting or dragging a screenshot, or typing a Base32 secret with custom digits, period and algorithm. Bulk import works with exports from Google Authenticator migration QR codes, Aegis, 2FAS, Bitwarden, LastPass, andOTP and Ente Auth, and bulk export writes TXT, JSON, CSV, HTML or a scannable Google Authenticator migration QR code. Secrets are stored in a Workers KV namespace and, once the ENCRYPTION_KEY secret is set, encrypted with AES-GCM 256; automatic backups are kept (100 by default) and can be pushed to WebDAV, S3-compatible storage, OneDrive or Google Drive. A companion browser extension for Chrome, Edge and Firefox reads and autofills codes, and the web app installs as a PWA with offline add/edit/import that syncs later. Deployment is either the Cloudflare deploy button (upgrades run through the Sync Upstream workflow) or a wrangler command line path; there is no Docker image. Only a single management password protects the instance, and OTP can also be exposed through unauthenticated public /otp/ URLs, which is a deliberate but security-relevant design.

## Links

- [Homepage](https://github.com/wuzf/2fa)
- [Website](https://2fa-dev.wzf.workers.dev)
- [Deployment guide](https://github.com/wuzf/2fa/blob/main/docs/DEPLOYMENT.md)
- [API reference](https://github.com/wuzf/2fa/blob/main/docs/API_REFERENCE.md)
- [Browser extension guide](https://github.com/wuzf/2fa/blob/main/docs/BROWSER_EXTENSION.md)
- [PWA guide](https://github.com/wuzf/2fa/blob/main/docs/PWA_GUIDE.md)
- [Chrome Web Store](https://chromewebstore.google.com/detail/2fa-%E9%AA%8C%E8%AF%81%E5%8A%A9%E6%89%8B/lifeiloiefdlbohelpjajdbopeocalhl)
- [Firefox Add-ons](https://addons.mozilla.org/zh-CN/firefox/addon/2fa-%E9%AA%8C%E8%AF%81%E5%8A%A9%E6%89%8B/)
- [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/kmchncmoddhdlbpfoejeahdjhieghklm)
- [GitHub repository](https://github.com/wuzf/2fa)

---
Source: https://selfhost.directory/project/2fa