https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/contrib/auth/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/contrib/auth/hashers.pyc
�
r�\c@sPddlmZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZmZmZdd	lmZdd
lmZmZmZddlmZddlmZd
ZdZda!da"ee
�d��Z#d�Z$ddd�Z%ddd�Z&dd�Z'dd�Z(d�Z)ddd�Z*de+fd��YZ,de,fd��YZ-de-fd��YZ.d e,fd!��YZ/d"e/fd#��YZ0d$e,fd%��YZ1d&e,fd'��YZ2d(e,fd)��YZ3d*e,fd+��YZ4d,e,fd-��YZ5dS(.i����(tunicode_literalsN(treceiver(tsettings(tsetting_changed(t	importlib(t
SortedDict(tforce_bytest	force_strt
force_text(tImproperlyConfigured(tpbkdf2tconstant_time_comparetget_random_string(timport_by_path(t
ugettext_noopu!i(cKs#|ddkrdadandS(NusettinguPASSWORD_HASHERS(tNonetHASHERStPREFERRED_HASHER(tkwargs((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyt
reset_hashersscCsF|dks|jt�rtSyt|�Wntk
rAtSXtS(N(Rt
startswithtUNUSABLE_PASSWORD_PREFIXtFalsetidentify_hashert
ValueErrortTrue(tencoded((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pytis_password_usable"s
udefaultcCs�|dkst|�rtSt|�}t|�}|j|jk}|s_|j|�}n|j||�}|r�|r�|r�||�n|S(u�
    Returns a boolean of whether the raw password matches the three
    part encoded digest.

    If setter is specified, it'll be called when you need to
    regenerate the password.
    N(RRRt
get_hasherRt	algorithmtmust_updatetverify(tpasswordRtsettert	preferredthasherRt
is_correct((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pytcheck_password,s
cCsK|dkrttt�St|�}|s;|j�}n|j||�S(u�
    Turn a plain-text password into a hash for database storage

    Same as encode() but generates a new random salt.
    If password is None then a concatenation of
    UNUSABLE_PASSWORD_PREFIX and a random string will be returned
    which disallows logins. Additional random string reduces chances
    of gaining access to staff or superuser accounts.
    See ticket #20079 for more info.
    N(RRRtUNUSABLE_PASSWORD_SUFFIX_LENGTHRtsalttencode(R R'R#((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyt
make_passwordCscCs�g}|stj}nxL|D]D}t|��}t|d�sVtd|��n|j|�qWtg|D]}|j|f^qq�a|da	dS(Nu	algorithmu,hasher doesn't specify an algorithm name: %si(
RtPASSWORD_HASHERSR
tgetattrR	tappendtdictRRR(tpassword_hashersthasherstbackendR#((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pytload_hashersXs

(cCszt|d�r|S|dkr9tdkr5t�ntStdkrOt�n|tkrntd|��nt|SdS(u�
    Returns an instance of a loaded password hasher.

    If algorithm is 'default', the default hasher will be returned.
    This function will also lazy import hashers specified in your
    settings file if needed.
    u	algorithmudefaultu\Unknown password hashing algorithm '%s'. Did you specify it in the PASSWORD_HASHERS setting?N(thasattrRRR1RR(R((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRhs


cCs�t|�dkrd|ks?t|�dkrH|jd�rHd}n@t|�dkrr|jd�rrd}n|jdd	�d
}t|�S(u�
    Returns an instance of a loaded password hasher.

    Identifies hasher algorithm by examining encoded hash, and calls
    get_hasher() to return hasher. Raises ValueError if
    algorithm cannot be identified, or if hasher is not loaded.
    i u$i%umd5$$uunsalted_md5i.usha1$$u
unsalted_sha1ii(tlenRtsplitR(RR((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�s
!	!	iu*cCs&|| }||t||�7}|S(u�
    Returns the given hash, with only the first ``show`` number shown. The
    rest are masked with ``char`` for security reasons.
    (R3(thashtshowtchartmasked((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyt	mask_hash�s
tBasePasswordHashercBsPeZdZdZdZd�Zd�Zd�Zd�Z	d�Z
d�ZRS(u�
    Abstract base class for password hashers

    When creating your own hasher, you need to override algorithm,
    verify(), encode() and safe_summary().

    PasswordHasher objects are immutable.
    cCs�|jdk	r�t|jttf�r9|j\}}n
|j}}ytj|�}Wn/tk
r�}td|j	j
|f��nX|Std|j	j
��dS(Nu&Couldn't load %r algorithm library: %su-Hasher %r doesn't specify a library attribute(tlibraryRt
isinstancettupletlistRt
import_moduletImportErrorRt	__class__t__name__(tselftnametmod_pathtmodulete((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyt
_load_library�s
cCst�S(uJ
        Generates a cryptographically secure nonce salt in ascii
        (R(RC((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR'�scCs
t��dS(u9
        Checks if the given password is correct
        N(tNotImplementedError(RCR R((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�scCs
t��dS(u�
        Creates an encoded database value

        The result is normally formatted as "algorithm$salt$hash" and
        must be fewer than 128 characters.
        N(RI(RCR R'((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCs
t��dS(u�
        Returns a summary of safe values

        The result is a dictionary and will be used where the password field
        must be displayed to construct a safe representation of the password.
        N(RI(RCR((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pytsafe_summary�scCstS(N(R(RCR((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�sN(RBt
__module__t__doc__RRR;RHR'RR(RJR(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR:�s							tPBKDF2PasswordHashercBsJeZdZdZdZejZdd�Z	d�Z
d�Zd�ZRS(u
    Secure password hashing using the PBKDF2 algorithm (recommended)

    Configured to use PBKDF2 + HMAC + SHA256 with 12000 iterations.
    The result is a 64 byte binary string.  Iterations may be changed
    safely but you must rename the algorithm if you change SHA256.
    u
pbkdf2_sha256i�.cCs�|dk	st�|r$d|ks*t�|s<|j}nt|||d|j�}tj|�jd�j�}d|j	|||fS(Nu$tdigestuasciiu%s$%d$%s$%s(
RtAssertionErrort
iterationsR
RNtbase64t	b64encodetdecodetstripR(RCR R'RPR5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCs[|jdd�\}}}}||jks3t�|j||t|��}t||�S(Nu$i(R4RROR(tintR(RCR RRRPR'R5t	encoded_2((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�scCs�|jdd�\}}}}||jks3t�ttd�|ftd�|ftd�t|�ftd�t|�fg�S(Nu$iu	algorithmu
iterationsusaltuhash(R4RRORt_R9(RCRRRPR'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ�scCs1|jdd�\}}}}t|�|jkS(Nu$i(R4RURP(RCRRRPR'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRsN(
RBRKRLRRPthashlibtsha256RNRR(RRJR(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRM�s				
tPBKDF2SHA1PasswordHashercBseZdZdZejZRS(u�
    Alternate PBKDF2 hasher which uses SHA1, the default PRF
    recommended by PKCS #5. This is compatible with other
    implementations of PBKDF2, such as openssl's
    PKCS5_PBKDF2_HMAC_SHA1().
    upbkdf2_sha1(RBRKRLRRXtsha1RN(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRZstBCryptSHA256PasswordHashercBsMeZdZdZejZdZdZd�Z	d�Z
d�Zd�ZRS(	u&
    Secure password hashing using the bcrypt algorithm (recommended)

    This is considered by many to be the most secure algorithm but you
    must first install the bcrypt library.  Please be warned that
    this library depends on native C code and might cause portability
    issues.
    u
bcrypt_sha256ubcrypticCs|j�}|j|j�S(N(RHtgensalttrounds(RCtbcrypt((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR' scCsw|j�}|jdk	rBtj|jt|��j��}nt|�}|j||�}d|jt|�fS(Nu%s$%s(	RHRNRtbinasciithexlifyRthashpwRR(RCR R'R_tdata((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR($s'cCs�|jdd�\}}||jks-t�|j�}|jdk	rotj|jt|��j��}nt|�}t|�}t|j	||��}t
||�S(Nu$i(R4RRORHRNRR`RaRRbR(RCR RRRcR_Rb((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR5s'c	Cs�|jdd�\}}}}}||jks6t�|d |d}}ttd�|ftd�|ftd�t|�ftd�t|�fg�S(Nu$iiu	algorithmuwork factorusaltuchecksum(R4RRORRWR9(	RCRRtemptytalgostrtwork_factorRcR'tchecksum((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJJs!(ubcryptubcrypt(
RBRKRLRRXRYRNR;R^R'R(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR\s				tBCryptPasswordHashercBseZdZdZdZRS(u
    Secure password hashing using the bcrypt algorithm

    This is considered by many to be the most secure algorithm but you
    must first install the bcrypt library.  Please be warned that
    this library depends on native C code and might cause portability
    issues.

    This hasher does not first hash the password which means it is subject to
    the 72 character bcrypt password truncation, most use cases should prefer
    the BCryptSha512PasswordHasher.

    See: https://code.djangoproject.com/ticket/20138
    ubcryptN(RBRKRLRRRN(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRhVstSHA1PasswordHashercBs/eZdZdZd�Zd�Zd�ZRS(u?
    The SHA1 password hashing algorithm (not recommended)
    usha1cCs]|dk	st�|r$d|ks*t�tjt||��j�}d|j||fS(Nu$u%s$%s$%s(RRORXR[Rt	hexdigestR(RCR R'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(oscCsO|jdd�\}}}||jks0t�|j||�}t||�S(Nu$i(R4RROR(R(RCR RRR'R5RV((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRuscCsy|jdd�\}}}||jks0t�ttd�|ftd�t|dd�ftd�t|�fg�S(Nu$iu	algorithmusaltR6uhash(R4RRORRWR9(RCRRR'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ{s(RBRKRLRR(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRiis
		tMD5PasswordHashercBs/eZdZdZd�Zd�Zd�ZRS(uE
    The Salted MD5 password hashing algorithm (not recommended)
    umd5cCs]|dk	st�|r$d|ks*t�tjt||��j�}d|j||fS(Nu$u%s$%s$%s(RRORXtmd5RRjR(RCR R'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCsO|jdd�\}}}||jks0t�|j||�}t||�S(Nu$i(R4RROR(R(RCR RRR'R5RV((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�scCsy|jdd�\}}}||jks0t�ttd�|ftd�t|dd�ftd�t|�fg�S(Nu$iu	algorithmusaltR6uhash(R4RRORRWR9(RCRRR'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ�s(RBRKRLRR(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRk�s
		tUnsaltedSHA1PasswordHashercBs8eZdZdZd�Zd�Zd�Zd�ZRS(u8
    Very insecure algorithm that you should *never* use; stores SHA1 hashes
    with an empty salt.

    This class is implemented because Django used to accept such password
    hashes. Some older Django installs still have these values lingering
    around so we need to handle and upgrade them properly.
    u
unsalted_sha1cCsdS(Nu((RC((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR'�scCs5|dkst�tjt|��j�}d|S(Nuusha1$$%s(RORXR[RRj(RCR R'R5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCs|j|d�}t||�S(Nu(R(R(RCR RRV((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�scCsP|jd�st�|d}ttd�|jftd�t|�fg�S(Nusha1$$iu	algorithmuhash(RRORRWRR9(RCRR5((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ�s

(RBRKRLRR'R(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRm�s			tUnsaltedMD5PasswordHashercBs8eZdZdZd�Zd�Zd�Zd�ZRS(u�
    Incredibly insecure algorithm that you should *never* use; stores unsalted
    MD5 hashes without the algorithm prefix, also accepts MD5 hashes with an
    empty salt.

    This class is implemented because Django used to store passwords this way
    and to accept such password hashes. Some older Django installs still have
    these values lingering around so we need to handle and upgrade them
    properly.
    uunsalted_md5cCsdS(Nu((RC((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR'�scCs+|dkst�tjt|��j�S(Nu(RORXRlRRj(RCR R'((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCsMt|�dkr.|jd�r.|d}n|j|d�}t||�S(Ni%umd5$$iu(R3RR(R(RCR RRV((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�s!
cCs7ttd�|jftd�t|dd�fg�S(Nu	algorithmuhashR6i(RRWRR9(RCR((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ�s(RBRKRLRR'R(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRn�s
			tCryptPasswordHashercBs>eZdZdZdZd�Zd�Zd�Zd�ZRS(uv
    Password hashing using UNIX crypt (not recommended)

    The crypt module is not supported on all platforms.
    ucryptcCs
td�S(Ni(R(RC((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR'�scCsP|j�}t|�dks$t�|jt|�|�}d|jd|fS(Niu%s$%s$%su(RHR3ROtcryptRR(RCR R'RpRc((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR(�scCs[|j�}|jdd�\}}}||jks<t�t||jt|�|��S(Nu$i(RHR4RRORRpR(RCR RRpRR'Rc((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyR�scCss|jdd�\}}}||jks0t�ttd�|ftd�|ftd�t|dd�fg�S(Nu$iu	algorithmusaltuhashR6i(R4RRORRWR9(RCRRR'Rc((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRJ�s(	RBRKRLRR;R'R(RRJ(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyRo�s			(6t
__future__RRQR`RXtdjango.dispatchRtdjango.confRtdjango.test.signalsRtdjango.utilsRtdjango.utils.datastructuresRtdjango.utils.encodingRRRtdjango.core.exceptionsR	tdjango.utils.cryptoR
RRtdjango.utils.module_loadingR
tdjango.utils.translationRRWRR&RRRRRR%R)R1RRR9tobjectR:RMRZR\RhRiRkRmRnRo(((s=/tmp/pip-install-XxeQeY/django/django/contrib/auth/hashers.pyt<module>sF	
	
=*D !

https://t.me/AnonymousX5 - 2025