https://github.com/smartlegionlab/smart-2fa-secure
Advanced Two-Factor Authentication system with enhanced security features.
https://github.com/smartlegionlab/smart-2fa-secure
2fa django django-2fa pypi-package python python-two-factor-authenticator secure security smartlegionlab two-factor-authentication
Last synced: 10 days ago
JSON representation
Advanced Two-Factor Authentication system with enhanced security features.
- Host: GitHub
- URL: https://github.com/smartlegionlab/smart-2fa-secure
- Owner: smartlegionlab
- License: bsd-3-clause
- Created: 2025-06-11T01:38:06.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-06-12T23:12:27.000Z (4 months ago)
- Last Synced: 2025-08-19T14:00:40.133Z (about 2 months ago)
- Topics: 2fa, django, django-2fa, pypi-package, python, python-two-factor-authenticator, secure, security, smartlegionlab, two-factor-authentication
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smart 2FA Security System v0.2.3
---
Advanced Two-Factor Authentication system with enhanced security features.
---
[](https://www.python.org/)
[]()
[]()
[](https://github.com/smartlegionlab/smart-2fa-secure/)
[](https://github.com/smartlegionlab/smart-2fa-secure/blob/master/LICENSE)
[](https://github.com/smartlegionlab/smart-2fa-secure/)
[](https://github.com/smartlegionlab/smart-2fa-secure/)
[](https://github.com/smartlegionlab/smart-2fa-secure/)
[](https://pypi.org/project/smart-2fa-secure/)
[](https://pypi.org/project/smart-2fa-secure)
[](https://pypi.org/project/smart-2fa-secure)## Key Security Features
- 🔐 **Complex Code Generation**:
- Supports ASCII letters, digits and special characters
- Customizable code length (default: 6)
- ⏱ **Flexible Expiration**:
- Adjustable TTL (Time-To-Live) for codes
- Default 60 seconds expiration- 📱 **Secure Delivery**:
- Telegram integration with customizable message templates## Installation
```bash
pip install smart-2fa-secure
```## Advanced Usage
```python
from smart_2fa_secure import Smart2FA
from smart_2fa_secure.exceptions import InvalidCodeErrorsmart_2fa = Smart2FA(
redis_host="localhost",
redis_port=6379,
telegram_token="YOUR_BOT_TOKEN",
code_ttl=60,
max_attempts=3,
code_length=6,
)
code = smart_2fa.send_code(user_id="user1", recipient="1234567", message="Your code:")# Verify with complex code
try:
smart_2fa.verify_code("user123", "A1b2@#")
print("Authentication successful!")
except InvalidCodeError:
print("Invalid security code!")```
## 💻 Information for developers:
- `pip install pytest`
- `pip install pytest-cov`
- `pip install setuptools`
- `pip install wheel`
- `pip install build`
- `pip install twine`- `pytest tests/ -v`
- `pytest tests/ -v --cov=smart_2fa_secure --cov-report=html`
- `python -m build` or `python setup.py sdist bdist_wheel`
- `twine upload dist/*`---

---
## Disclaimer of liability:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.***
## Copyright:
--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2018-2025, A.A. Suvorov
All rights reserved.
--------------------------------------------------------