+
    i`0                        R t ^ RIHt ^ RIt]P                  ! ]4      t^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ]! R4      P                   t^ RIHu Ht . ROt ! R R]P.                  ]P0                  ]P2                  4      t ! R R	]P2                  4      t]P8                  ! R
]RRRR7      t ! R R]P<                  ]P2                  4      t ! R R]P<                  ]P2                  4      t R# )z;passlib.handlers.nthash - Microsoft Windows -related hashes)hexlifyN)warn)
to_unicoderight_pad_string)unicode)lookup_hashmd4lmhashnthash
bsd_nthashmsdccmsdcc2c                   ~   a  ] tR t^t o RtR tR	t]P                  t	^ t
^tRt]R 4       tR tRt]R
R l4       tRtV tR# )r	   a  This class implements the Lan Manager Password hash, and follows the :ref:`password-hash-api`.

It has no salt and a single fixed round.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts a single
optional keyword:

:param bool truncate_error:
    By default, this will silently truncate passwords larger than 14 bytes.
    Setting ``truncate_error=True`` will cause :meth:`~passlib.ifc.PasswordHash.hash`
    to raise a :exc:`~passlib.exc.PasswordTruncateError` instead.

    .. versionadded:: 1.7

The :meth:`~passlib.ifc.PasswordHash.hash` and :meth:`~passlib.ifc.PasswordHash.verify` methods accept a single
optional keyword:

:type encoding: str
:param encoding:

    This specifies what character encoding LMHASH should use when
    calculating digest. It defaults to ``cp437``, the most
    common encoding encountered.

Note that while this class outputs digests in lower-case hexadecimal,
it will accept upper-case as well.
cp437c                "    VP                  4       # Nlowerclshashs   &&V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/handlers/windows.py
_norm_hashlmhash._norm_hashU       zz|    c                    V P                   '       d   V P                  V4       \        V P                  WP                  4      4      P                  R 4      # ascii)use_defaults_check_truncate_policyr   rawencodingdecodeselfsecrets   &&r   _calc_checksumlmhash._calc_checksumY   s?    ''/txx67>>wGGr   s   KGS!@#$%Nc                   V'       g   V P                   p^ RIHp V P                  p\	        V\
        4      '       d!   VP                  4       P                  V4      pM2\	        V\        4      '       d   VP                  4       pM\        R4      h\        V^4      pV! VR,          V4      V! VR,          V4      ,           # )aD  encode password using LANMAN hash algorithm.

:type secret: unicode or utf-8 encoded bytes
:arg secret: secret to hash
:type encoding: str
:arg encoding:
    optional encoding to use for unicode inputs.
    this defaults to ``cp437``, which is the
    common case for most situations.

:returns: returns string of raw bytes
)des_encrypt_blockzsecret must be unicode or bytes:       N:r,      N)default_encodingpasslib.crypto.desr*   _magic
isinstancer   upperencodebytes	TypeErrorr   )r   r&   r"   r*   MAGICs   &&&  r   r!   
lmhash.rawc   s     ++H 	9

fg&& \\^**84F&&
 \\^F=>>!&"- e4 u56 	6r    )truncate_errorr   )__name__
__module____qualname____firstlineno____doc__namesetting_kwdsuh	HEX_CHARSchecksum_charschecksum_sizetruncate_sizer.   classmethodr   r'   r0   r!   __static_attributes____classdictcell____classdict__s   @r   r	   r	      si     D D&L
 \\NM
 M
 
  H F#6 #6r   c                   ~   a  ] tR t^t o RtR t]P                  t^ t	]
R 4       tR t]
R 4       t]
RR l4       tRtV tR# )	r
   ap  This class implements the NT Password hash, and follows the :ref:`password-hash-api`.

It has no salt and a single fixed round.

The :meth:`~passlib.ifc.PasswordHash.hash` and :meth:`~passlib.ifc.PasswordHash.genconfig` methods accept no optional keywords.

Note that while this class outputs lower-case hexadecimal digests,
it will accept upper-case digests as well.
c                "    VP                  4       # r   r   r   s   &&r   r   nthash._norm_hash   r   r   c                T    \        V P                  V4      4      P                  R 4      # r   )r   r!   r#   r$   s   &&r   r'   nthash._calc_checksum   s!    txx'(//88r   c                n    \        VRRR7      p\        VP                  R4      4      P                  4       # )zencode password using MD4-based NTHASH algorithm

:arg secret: secret as unicode or utf-8 encoded bytes

:returns: returns string of raw bytes
utf-8r&   param	utf-16-le)r   r   r3   digest)r   r&   s   &&r   r!   
nthash.raw   s/     FG8<6==-.5577r   c                    \        R \        4       \        P                  V4      pV'       d   \	        V4      P                  R4      # T# )zfnthash.raw_nthash() is deprecated, and will be removed in Passlib 1.8, please use nthash.raw() insteadr   )r   DeprecationWarningr
   r!   r   r#   )r   r&   hexrets   &&& r   
raw_nthashnthash.raw_nthash   s>     ?	! jj /2ws|""7+;;r   r8   N)F)r:   r;   r<   r=   r>   r?   rA   rB   rC   rD   rF   r   r'   r!   r[   rG   rH   rI   s   @r   r
   r
      s`      D\\NM
  9 	8 	8 < <r   z$3$$aZ  The class support FreeBSD's representation of NTHASH
    (which is compatible with the :ref:`modular-crypt-format`),
    and follows the :ref:`password-hash-api`.

    It has no salt and a single fixed round.

    The :meth:`~passlib.ifc.PasswordHash.hash` and :meth:`~passlib.ifc.PasswordHash.genconfig` methods accept no optional keywords.
    )prefixidentdocc                   j   a  ] tR t^t o RtR t]P                  t^ t	]
R 4       tR t]
R 4       tRtV tR# )r   a  This class implements Microsoft's Domain Cached Credentials password hash,
and follows the :ref:`password-hash-api`.

It has a fixed number of rounds, and uses the associated
username as the salt.

The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods
have the following optional keywords:

:type user: str
:param user:
    String containing name of user account this password is associated with.
    This is required to properly calculate the hash.

    This keyword is case-insensitive, and should contain just the username
    (e.g. ``Administrator``, not ``SOMEDOMAIN\Administrator``).

Note that while this class outputs lower-case hexadecimal digests,
it will accept upper-case digests as well.
c                "    VP                  4       # r   r   r   s   &&r   r   msdcc._norm_hash  r   r   c                h    \        V P                  WP                  4      4      P                  R 4      # r   r   r!   userr#   r$   s   &&r   r'   msdcc._calc_checksum
  %    txx		23::7CCr   c                    \        VRRR7      P                  R4      p\        VRRR7      P                  4       P                  R4      p\        \        V4      P	                  4       V,           4      P	                  4       # )zencode password using mscash v1 algorithm

:arg secret: secret as unicode or utf-8 encoded bytes
:arg user: username to use as salt

:returns: returns string of raw bytes
rQ   r&   rR   rT   re   )r   r3   r   r   rU   )r   r&   re   s   &&&r   r!   	msdcc.raw  se     FG8<CCKP$v6<<>EEkR3v;%%'$./6688r   r8   Nr:   r;   r<   r=   r>   r?   rA   rB   rC   rD   rF   r   r'   r!   rG   rH   rI   s   @r   r   r      sK     ( D\\NM D 
9 
9r   c                   j   a  ] tR tRt o RtR t]P                  t^ t	]
R 4       tR t]
R 4       tRtV tR# )r   i  a  This class implements version 2 of Microsoft's Domain Cached Credentials
password hash, and follows the :ref:`password-hash-api`.

It has a fixed number of rounds, and uses the associated
username as the salt.

The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods
have the following extra keyword:

:type user: str
:param user:
    String containing name of user account this password is associated with.
    This is required to properly calculate the hash.

    This keyword is case-insensitive, and should contain just the username
    (e.g. ``Administrator``, not ``SOMEDOMAIN\Administrator``).
c                "    VP                  4       # r   r   r   s   &&r   r   msdcc2._norm_hash3  r   r   c                h    \        V P                  WP                  4      4      P                  R 4      # r   rd   r$   s   &&r   r'   msdcc2._calc_checksum7  rg   r   c                "   ^ RI Hp \        VRRR7      P                  R4      p\        VRRR7      P	                  4       P                  R4      p\        \        V4      P                  4       V,           4      P                  4       pV! RWBR^4      # )	zencode password using msdcc v2 algorithm

:type secret: unicode or utf-8 bytes
:arg secret: secret

:type user: str
:arg user: username to use as salt

:returns: returns string of raw bytes
)pbkdf2_hmacrQ   r&   rR   rT   re   sha1i (  )passlib.crypto.digestrq   r   r3   r   r   rU   )r   r&   re   rq   tmps   &&&  r   r!   
msdcc2.raw:  sx     	6FG8<CCKP$v6<<>EEkR#f+$$&-.55763eR88r   r8   Nrj   rI   s   @r   r   r     sK     " D\\NM D 9 9r   )r	   r
   r   r   r   )!r>   binasciir   logging	getLoggerr:   logwarningsr   passlib.utilsr   r   passlib.utils.compatr   rs   r   constr   passlib.utils.handlersutilshandlersrA   __all__TruncateMixinHasEncodingContextStaticHandlerr	   r
   PrefixWrapperr   HasUserContextr   r   r8   r   r   <module>r      s    A
  g''1  7 ( -% # #k6Rr44b6F6F k6h-<R -<f lF6		
T+9Br// +9`-9R 0 0 -9r   