__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

XR_X���SrSSKr\R"\5rSSKJrJrJrJ	r	 SSK
JrJr SSK
JrJrJrJr SSKJrJr SSKJs Jr S/r"SS\R4\R6\R8\R:5rg)	z:passlib.handlers.scram - hash for SCRAM credential storage�N)�consteq�saslprep�
to_native_str�
splitcomma)�ab64_decode�ab64_encode)�
bascii_to_str�	iteritems�u�native_string_types)�pbkdf2_hmac�norm_hash_name�scramc�^�\rSrSrSrSrSr\"S5rSr	Sr
SrSrS	r
S
r/SQr/SQrS
r\S5r\SSj5r\S5r\S5rSr\SU4Sjj5rSU4SjjrSSjr\S5rU4SjrSSjr\SSj5rSrU=r $)r�a�This class provides a format for storing SCRAM passwords, and follows
the :ref:`password-hash-api`.

It supports a variable-length salt, and a variable number of rounds.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: bytes
:param salt:
    Optional salt bytes.
    If specified, the length must be between 0-1024 bytes.
    If not specified, a 12 byte salt will be autogenerated
    (this is recommended).

:type salt_size: int
:param salt_size:
    Optional number of bytes to use when autogenerating new salts.
    Defaults to 12 bytes, but can be any value between 0 and 1024.

:type rounds: int
:param rounds:
    Optional number of rounds to use.
    Defaults to 100000, but must be within ``range(1,1<<32)``.

:type algs: list of strings
:param algs:
    Specify list of digest algorithms to use.

    By default each scram hash will contain digests for SHA-1,
    SHA-256, and SHA-512. This can be overridden by specify either be a
    list such as ``["sha-1", "sha-256"]``, or a comma-separated string
    such as ``"sha-1, sha-256"``. Names are case insensitive, and may
    use :mod:`!hashlib` or `IANA <http://www.iana.org/assignments/hash-function-text-names>`_
    hash names.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include ``rounds``
    that are too small or too large, and ``salt`` strings that are too long.

    .. versionadded:: 1.6

In addition to the standard :ref:`password-hash-api` methods,
this class also provides the following methods for manipulating Passlib
scram hashes in ways useful for pluging into a SCRAM protocol stack:

.. automethod:: extract_digest_info
.. automethod:: extract_digest_algs
.. automethod:: derive_digest
)�salt�	salt_size�rounds�algs�$scram$�ii���l���linear)�sha-1�sha-256�sha-512)rrzsha-224zsha-384rNc��[US5nURU5nURnU(d[S5eURUR
XB4$)aHreturn (salt, rounds, digest) for specific hash algorithm.

:type hash: str
:arg hash:
    :class:`!scram` hash stored for desired user

:type alg: str
:arg alg:
    Name of digest algorithm (e.g. ``"sha-1"``) requested by client.

    This value is run through :func:`~passlib.crypto.digest.norm_hash_name`,
    so it is case-insensitive, and can be the raw SCRAM
    mechanism name (e.g. ``"SCRAM-SHA-1"``), the IANA name,
    or the hashlib name.

:raises KeyError:
    If the hash does not contain an entry for the requested digest
    algorithm.

:returns:
    A tuple containing ``(salt, rounds, digest)``,
    where *digest* matches the raw bytes returned by
    SCRAM's :func:`Hi` function for the stored password,
    the provided *salt*, and the iteration count (*rounds*).
    *salt* and *digest* are both raw (unencoded) bytes.
�ianazscram hash contains no digests)r�from_string�checksum�
ValueErrorrr)�cls�hash�alg�self�chkmaps     �8/usr/lib/python3/dist-packages/passlib/handlers/scram.py�extract_digest_info�scram.extract_digest_info|sM��>�S�&�)�����t�$��������=�>�>��y�y�$�+�+�v�{�2�2�c��URU5RnUS:XaU$UVs/sHn[XB5PM sn$s snf)a�Return names of all algorithms stored in a given hash.

:type hash: str
:arg hash:
    The :class:`!scram` hash to parse

:type format: str
:param format:
    This changes the naming convention used by the
    returned algorithm names. By default the names
    are IANA-compatible; possible values are ``"iana"`` or ``"hashlib"``.

:returns:
    Returns a list of digest algorithms; e.g. ``["sha-1"]``
r)rrr)r"r#�formatrr$s     r'�extract_digest_algs�scram.extract_digest_algs�sB��(���t�$�)�)���V���K�;?�@�4�C�N�3�/�4�@�@��@s�Ac�z�[U[5(aURS5n[U[	U5X#5$)a�helper to create SaltedPassword digest for SCRAM.

This performs the step in the SCRAM protocol described as::

    SaltedPassword  := Hi(Normalize(password), salt, i)

:type password: unicode or utf-8 bytes
:arg password: password to run through digest

:type salt: bytes
:arg salt: raw salt data

:type rounds: int
:arg rounds: number of iterations.

:type alg: str
:arg alg: name of digest to use (e.g. ``"sha-1"``).

:returns:
    raw bytes of ``SaltedPassword``
zutf-8)�
isinstance�bytes�decoder
r)r"�passwordrrr$s     r'�
derive_digest�scram.derive_digest�s5��.�h��&�&����w�/�H��3��� 2�D�A�Ar*c�|�[USS5nURS5(d[RR	U5eUSSRS5n[
U5S:wa[RRU5eUup4n[U5nU[U5:wa[RRU5e[URS55nU(d[RRU5eSU;aMSn0n	URS5H3n
U
RS5up�[URS55X�'M5 OUnSn	U"UUU	US	9$![a  [RRU5ef=f![a  [RRU5ef=f)
N�asciir#r��$��=�,)rrr r)
r�
startswith�uh�exc�InvalidHashError�split�len�MalformedHashError�int�strr�encode�	TypeError)
r"r#�parts�
rounds_str�salt_str�chk_strrrrr&�pairr$�digests
             r'r�scram.from_string�s����T�7�F�3�����y�)�)��&�&�)�)�#�.�.��Q�R����s�#���u�:��?��&�&�+�+�C�0�0�(-�%�
�g��Z�����V��$��&�&�+�+�C�0�0�	1��x���w�7�8�D�
��&�&�+�+�C�0�0�
�G�^��D��F��
�
�c�*��"�j�j��o���9�"-�f�m�m�G�.D�"E�F�K�+��D��F������	
�	
��/�	1��&�&�+�+�C�0�0�	1��!�9��&�&�3�3�C�8�8�9�s�E$�6F�$*F�*F;c��^�[[UR55nURmSR	U4SjUR
55nSURX4-$)Nr<c	3�`># �UH#nU<S[[TU55<3v� M% g7f)r;N)r	r)�.0r$r&s  �r'�	<genexpr>�"scram.to_string.<locals>.<genexpr>s+����
� ���M�+�f�S�k�*B�C�D� �s�+.z$scram$%d$%s$%s)r	rrr �joinrr)r%rrKr&s   @r'�	to_string�scram.to_string
sT����[����3�4�������(�(�
��y�y�
�
��!�D�K�K��#?�?�?r*c�v>�UbUbeUn[[U]
"S0UD6nUbURU5UlU$)N�)�superr�using�
_norm_algs�default_algs)r"r\r�kwds�subcls�	__class__s     �r'rZ�scram.usingsP������'�'�'��L��u�c�(�0�4�0���#�"%�.�.��">�F���
r*c�>�[[U]
"S0UD6 URnUb Ub[	S5eURU5nOuUb URUR
55nORUR(a6[UR5nURU5U:XdSU<35eO[S5eXlg)Nz+checksum & algs kwds are mutually exclusivezinvalid default algs: zno algs list specifiedrX)rYr�__init__r �RuntimeErrorr[�keys�use_defaults�listr\rGr)r%rr]�
digest_mapr_s    �r'rb�scram.__init__+s����
�e�T�#�+�d�+��]�]�
����%�"�#P�Q�Q��?�?�4�(�D�
�
#��?�?�:�?�?�#4�5�D�
�
�
���)�)�*�D��?�?�4�(�D�0�V�PT�2V�V�0��4�5�5��	r*c��[U[5(d![RR	USS5e[U5Hxup4U[
US5:wa[SU<35e[U5S:�a[SU<35e[U[5(aMY[RR	USS5e S	U;a[S
5eU$)N�dictr rz(malformed algorithm name in scram hash: �	z.SCRAM limits algorithm names to 9 characters: z	raw bytes�digestsr�-sha-1 must be in algorithm list of scram hash)
r0rjr>r?�ExpectedTypeErrorr
rr!rBr1)r%r �relaxedr$rMs     r'�_norm_checksum�scram._norm_checksum>s����(�D�)�)��&�&�*�*�8�V�Z�H�H�$�X�.�K�C��n�S�&�1�1� �"%�"(�)�)��3�x�!�|� �7:�"=�>�>��f�e�,�,��f�f�.�.�v�{�I�N�N�/��(�"��L�M�M��r*c���[U[5(a[U5n[SU55n[	SU55(a[S5eSU;a[S5eU$)znormalize algs parameterc3�:# �UHn[US5v� M g7f)rN)r�rQr$s  r'rR�#scram._norm_algs.<locals>.<genexpr>Us���B�T�c�n�S�&�1�1�T�s�c3�># �UHn[U5S:�v� M g7f)rkN)rBrts  r'rRruVs���*�T�c�s�3�x��z�T�s�z-SCRAM limits alg names to max of 9 charactersrrm)r0rr�sorted�anyr!)r"rs  r'r[�scram._norm_algsPsb���d�/�0�0��d�#�D��B�T�B�B���*�T�*�*�*��L�M�M��$���L�M�M��r*c�>�[UR5RUR5(dg[[
U]"S0UD6$)NTrX)�setr�
issupersetr\rYr�_calc_needs_update)r%r]r_s  �r'r}�scram._calc_needs_update`s>����4�9�9�~�(�(��):�):�;�;���U�D�4�<�t�<�<r*c�^^^^�URmURmURmU(aT"TTTU5$[UUUU4SjUR55$)Nc3�>># �UHnUT"TTTU54v� M g7f�NrX)rQr$r#rr�secrets  ����r'rR�'scram._calc_checksum.<locals>.<genexpr>vs(�����$�C��d�6�4���5�6�$�s�)rrr4rjr)r%r�r$r#rrs ` @@@r'�_calc_checksum�scram._calc_checksummsT��������y�y���!�!������f�c�2�2����9�9���
r*c��[R"U5 URU5nURnU(d([	SUR
<SUR
<S35eU(a�S=pg[
U5Hmup�URX5n
[U	5[U
5:wa)[	SU<S[U	5<S[U
5<35e[X�5(aSnMkSnMo U(aU(a[	S	5eU$URH)nX�;dM
URX5n
[X�U5s $ [S
5e)Nz	expected z hash, got z config string insteadFz
mis-sized z digest in scram hash: z != Tz4scram hash verified inconsistently, may be corruptedzsha-1 digest not found!)r>�validate_secretrr r!�namer
r�rBr�_verify_algs�AssertionError)r"r�r#�fullr%r&�correct�failedr$rM�others           r'�verify�scram.verify{s&��
���6�"����t�$��������!�h�h����2�3�
3��$�$�G�(��0����+�+�F�8��
�v�;�#�e�*�,�$�(+�S��[�#�e�*�&F�G�G��5�)�)�"�G�!�F� 1��6� �"4�5�5����(�(���=� �/�/��<�E�"�5��+�6�6�)�!�!:�;�;r*)r)r)NNr�)F)!�__name__�
__module__�__qualname__�__firstlineno__�__doc__r��setting_kwdsr�ident�default_salt_size�
max_salt_size�default_rounds�
min_rounds�
max_rounds�rounds_costr\r�r�classmethodr(r-r4rrUrZrbrpr[r}r�r��__static_attributes__�
__classcell__)r_s@r'rrs���4�B�D�:�L�
�i�L�E����M��N��J��J��K�
3�L�I�L��D�
�#3��#3�J�A��A�2�B��B�@�-
��-
�^@�����"�&�$�
��
�=���(<��(<r*)r��logging�	getLoggerr��log�
passlib.utilsrrrr�passlib.utils.binaryrr�passlib.utils.compatr	r
rr�passlib.crypto.digestr
r�passlib.utils.handlers�utils�handlersr>�__all__�	HasRounds�
HasRawSalt�HasRawChecksum�GenericHandlerrrXr*r'�<module>r�sk��@�
�g�'�'��1��G�F�9�Q�Q�=�#�#����N<�B�L�L�"�-�-��):�):�B�<M�<M�N<r*

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 250 B 0644
argon2.cpython-313.pyc File 29.75 KB 0644
bcrypt.cpython-313.pyc File 38.25 KB 0644
cisco.cpython-313.pyc File 12.55 KB 0644
des_crypt.cpython-313.pyc File 20.36 KB 0644
digests.cpython-313.pyc File 6.2 KB 0644
django.cpython-313.pyc File 20.54 KB 0644
fshp.cpython-313.pyc File 7.61 KB 0644
ldap_digests.cpython-313.pyc File 13.81 KB 0644
md5_crypt.cpython-313.pyc File 8.95 KB 0644
misc.cpython-313.pyc File 11.23 KB 0644
mssql.cpython-313.pyc File 9.08 KB 0644
mysql.cpython-313.pyc File 4.29 KB 0644
oracle.cpython-313.pyc File 6.42 KB 0644
pbkdf2.cpython-313.pyc File 17.2 KB 0644
phpass.cpython-313.pyc File 4.8 KB 0644
postgres.cpython-313.pyc File 2.03 KB 0644
roundup.cpython-313.pyc File 886 B 0644
scram.cpython-313.pyc File 14.6 KB 0644
scrypt.cpython-313.pyc File 12.57 KB 0644
sha1_crypt.cpython-313.pyc File 5.76 KB 0644
sha2_crypt.cpython-313.pyc File 15.02 KB 0644
sun_md5_crypt.cpython-313.pyc File 11.85 KB 0644
windows.cpython-313.pyc File 10.9 KB 0644
Filemanager