+
    i5                     ,   R t ^ RIHt ^ RIt]P                  ! ]4      t^ RIHtH	t	H
t
 ^ RIHt ^ RIHtHt ^ RIHu Ht RR.tRtR	tR
tRtRtRR lt ! R R]P6                  ]P8                  4      t ! R R]P<                  ]4      t ! R R]4      t R# )z0passlib.handlers.md5_crypt - md5-crypt algorithm)md5N)
safe_crypt
test_cryptrepeat_string)h64)unicodeu	md5_cryptapr_md5_crypt    s   $1$s   $apr1$c                \   \        V \        4      '       d   V P                  R4      p \        V \        4      '       g   Q R4       h\        V 9   d$   \
        P                  P                  \        4      h\        V 4      p\        V\        4      '       g   Q R4       hVP                  R4      p\        V4      ^	8  g   Q R4       hV'       d   \        pM\        p\        W,           V ,           4      P                  4       p\        W,           V,           4      pVP                  pV! \        WS4      4       TpV R,          p	V'       d)   T! V^,          '       d   \        MT	4       V^,          pK0  VP                  4       p
W ,           pW,           pWWV ,           W,           W,           .p\          UUu. uF  w  rW,          W,          3NK  	  pppT
p^pV'       dU   V FC  w  r\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  V^,          pK\  VR,           FC  w  r\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  \"        P$                  ! V\&        4      P)                  R4      # u uppi )ab  perform raw md5-crypt calculation

this function provides a pure-python implementation of the internals
for the MD5-Crypt algorithms; it doesn't handle any of the
parsing/validation of the hash strings themselves.

:arg pwd: password chars/bytes to hash
:arg salt: salt chars to use
:arg use_apr: use apache variant

:returns:
    encoded checksum chars
zutf-8zpwd not unicode or byteszsalt not unicodeasciizsalt too large:N   N:N   N)
isinstancer   encodebytes_BNULLuhexcNullPasswordErrorr	   len
_APR_MAGIC
_MD5_MAGICr   digestupdater   _c_digest_offsetsr   encode_transposed_bytes_transpose_mapdecode)pwdsaltuse_aprpwd_lenmagicdba_ctxa_ctx_updateievenchardapwd_pwdpwd_saltpermsevenodddatadcblockss   &&&                X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/handlers/md5_crypt.py_raw_md5_cryptr4   ,   s(   4 #wjj!c5!!=#==!}ff&&y11#hG dG$$8&88$;;wDt9q=***= 
 
SZ#		%	%	'B d"#E<<L r+, 	A2wH
q1uuV(3	a 
B\ gGxH8c\48T\JE 9JJ8I94ek5:&8IDJ 
BF
IDS3rDy>00223::<B ! #YY	s29~,,../668  &&r>:AA'JJ# Ks   0J(c                   v   a  ] tR t^t o RtRt^t]P                  t	^t
]P                  t]R 4       tR tRtV tR# )_MD5_Commonz+common code for md5_crypt and apr_md5_cryptc                \    \         P                  ! WP                  V R 7      w  r#V ! W#R7      # ))handler)r!   checksum)r   	parse_mc2ident)clshashr!   chks   &&  r3   from_string_MD5_Common.from_string   s#    LLyy#>	++    c                n    \         P                  ! V P                  V P                  V P                  4      # N)r   
render_mc2r;   r!   r9   )selfs   &r3   	to_string_MD5_Common.to_string   s!    }}TZZDMMBBrA    N)r!   	salt_size)__name__
__module____qualname____firstlineno____doc__setting_kwdschecksum_sizer   HASH64_CHARSchecksum_charsmax_salt_size
salt_charsclassmethodr?   rF   __static_attributes____classdictcell____classdict__s   @r3   r6   r6      sK     5
 )LM__NMJ , ,C CrA   r6   c                   h   a  ] tR t^t o RtR t]! R4      tR	t]	R 4       t
R t]	R 4       tR tRtV tR# )
r	   a=  This class implements the MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

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

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type salt_size: int
:param salt_size:
    Optional number of characters to use when autogenerating new salts.
    Defaults to 8, but can be any value between 0 and 8.
    (This is mainly needed when generating Cisco-compatible hashes,
    which require ``salt_size=4``).

: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
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$1$c                d    \        R R4      '       d   V P                  V P                  4       R# R# )testz$1$test$pi/xDtU5WFVRqYS6BMU8X/TF)r   _set_calc_checksum_backend_calc_checksum_os_cryptr<   s   &r3   _load_backend_os_crypt md5_crypt._load_backend_os_crypt  s*    f>??**3+F+FGrA   c                4   V P                   V P                  ,           p\        W4      pVf   V P                  V4      # VP	                  V4      '       d!   \        V4      \        V4      ^,           8w  d!   \        P                  P                  WV4      hVRR  # )Ni)	r;   r!   r   _calc_checksum_builtin
startswithr   r   r   CryptBackendError)rE   secretconfigr=   s   &&  r3   r^   !md5_crypt._calc_checksum_os_crypt  s|    dii'&)< ..v66v&&#d)s6{R7G*G&&**4>>CDzrA   c                <    V P                  V P                  4       R # )T)r]   rc   r_   s   &r3   _load_backend_builtinmd5_crypt._load_backend_builtin%  s    &&s'A'ABrA   c                ,    \        WP                  4      # rC   r4   r!   rE   rf   s   &&r3   rc    md5_crypt._calc_checksum_builtin*  s    fii00rA   rH   N)os_cryptbuiltin)rJ   rK   rL   rM   rN   namer   r;   backendsrU   r`   r^   rj   rc   rV   rW   rX   s   @r3   r	   r	      sY     @ DeHE 'H
  	  1 1rA   c                   >   a  ] tR tRt o RtR t]! R4      tR tRt	V t
R# )r
   i1  a0  This class implements the Apr-MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

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

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

: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
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$apr1$c                0    \        WP                  R R7      # )T)r"   rm   rn   s   &&r3   _calc_checksumapr_md5_crypt._calc_checksumQ  s    fii>>rA   rH   N)rJ   rK   rL   rM   rN   rr   r   r;   rv   rV   rW   rX   s   @r3   r
   r
   1  s$     2 DhKE
? ?rA   ))          r   r{   ry   )r      rz   r|   r   ry   )   r   r|   r~   )r{   rx   r|   r~   rz   )r   ry   r~   rz   )r{   r}   r~   rz   r|   )      rx         r         r}      	   ry   r{   
   r      )F)!rN   hashlibr   logging	getLoggerrJ   logpasslib.utilsr   r   r   passlib.utils.binaryr   passlib.utils.compatr   r   passlib.utils.handlersutilshandlersr   __all__r   r   r   r   r   r4   HasSaltGenericHandlerr6   HasManyBackendsr	   r
   rH   rA   r3   <module>r      s    6
  g''1 @ ? $ + # #  


  HOKhC"**b// C@K1""K K1b!?K !?rA   