Skip to main content

Advanced Two-Factor Authentication system with enhanced security features.

Project description

Smart 2FA Security System v0.2.3


Advanced Two-Factor Authentication system with enhanced security features.


Python Version License Security

GitHub top language GitHub release (latest by date) GitHub GitHub Repo stars GitHub watchers GitHub forks PyPI - Downloads PyPI PyPI - Format

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

pip install smart-2fa-secure

Advanced Usage

from smart_2fa_secure import Smart2FA
from smart_2fa_secure.exceptions import InvalidCodeError

smart_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/*


LOGO


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.
--------------------------------------------------------

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_2fa_secure-0.2.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_2fa_secure-0.2.3-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file smart_2fa_secure-0.2.3.tar.gz.

File metadata

  • Download URL: smart_2fa_secure-0.2.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smart_2fa_secure-0.2.3.tar.gz
Algorithm Hash digest
SHA256 113a882ea5aeee1566960ee8944ea80f40cc67e07930296b94f6c91e87723096
MD5 3bfe9053379a97117099414cae63f69e
BLAKE2b-256 7c68b937c6c694bf7c8288483498be4cc62001ae38cc5b3732b83e8c3584c14f

See more details on using hashes here.

File details

Details for the file smart_2fa_secure-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_2fa_secure-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 57a4a58e30c6d3bf89a13843cf4a1692a21dbd5e324ab6cf11e5fc28843a77e6
MD5 1362e98392820f9040b7e69d6e273c06
BLAKE2b-256 abf121324936ced970ba71724f7349ff8383680cd92457c5d2a8cddf3e86300c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page