| Server IP : 157.22.201.140 / Your IP : 216.73.216.74 Web Server : nginx/1.30.1 System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/passlib/__pycache__/ |
Upload File : |
�
`Άe � �� � d Z ddlmZ ddlZddlZddlZddlZ ej e� Z ddl
Z
ddlZddlZddl
ZddlZer
ddlmZmZmZmZ nddlmZmZ ddlmZmZ ddlmZ ddlmZ ddlZddlZdd lmZ [ddl#m$Z$ ddl%m&Z&m'Z'm(Z(m)Z) dd
l*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 ddl3m4Z4m5Z5m6Z6 ddlm7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ ddlAmBZBmCZC ddlDmEZEmFZFmGZG ddlHmIZI g d�ZJej� dk r.ddlmLZL deLvr# eLj� d� e jE d� [L ej� e7d� ej� � ZPg d�ZQd� ZRd,d�ZSd� ZT eUe � ZV ej� d� ZW G d� deX� ZY ej� d � j� Z\ ej� d!� j� Z^d"Z_ G d#� d$eX� Z` G d%� d&e0� Za G d'� d(e0� Zbd)e4dd* fd+�Zcy# e!$ r e jE d
� dxZ ZY ��yw xY w)-z@passlib.totp -- TOTP / RFC6238 / Google Authenticator utilities.� )�PY3N)�urlparse� parse_qsl�quote�unquote)r r )r r )�warn)�default_backend)�ciphersz=can't import 'cryptography' package, totp encryption disabled)�exc)�
TokenError�MalformedTokenError�InvalidTokenError�UsedTokenError)�
to_unicode�to_bytes�consteq�getrandbytes�rng�
SequenceMixin� xor_bytes�
getrandstr)�BASE64_CHARS� b32encode� b32decode)
�u�unicode�native_string_types�
bascii_to_str� int_types� num_types�irange�byte_elem_value� UnicodeIO�suppress_cause)�
hybrid_method�memoized_property)�lookup_hash�compile_hmac�pbkdf2_hmac)�
pbkdf2_sha256)� AppWallet�TOTPr r
r r � TotpToken� TotpMatch)� � � )�
uses_query�otpauthz4registered 'otpauth' scheme with urlparse.uses_queryz\s|[-=])r1 � � c �z � t D ] }| |z r� |c S t d }d}t D ] }| |z |kD s�|}| |z }� |S )zb
helper for group_string() --
calculates optimal size of group for given string size.
r )�_chunk_sizes)�klen�size�best�rems �./usr/lib/python3/dist-packages/passlib/totp.py�_get_group_sizer= X s_ � � � ���d�{��K��
��?�D�
�C�� ���$�;����D���+�C�� �K� c �~ � �� t � � }t |� �|j �� fd�t d|�� D � � S )z�
reformat string into (roughly) evenly-sized groups, separated by **sep**.
useful for making tokens & keys easier to read by humans.
c 3 �. �K � | ] }�||�z �� � y �w�N� )�.0�or9 �values ��r<