+
    i#                     :   R t ^ RIHtHt ^ RIHt ^ RIt^ RIt]P                  ! ]	4      t
^ RIHtHt ^ RIHtHtHtHtHt ^ RIHt ^ RIHu Ht RR.tRR	 ltR
t ! R R]P:                  ]P<                  4      t ! R R]P@                  ]PB                  4      t"R# )z3passlib.handlers.oracle - Oracle DB Password Hashes)hexlify	unhexlify)sha1N)
to_unicode	xor_bytes)irangeuuascii_to_strunicodestr_to_uascii)des_encrypt_block	oracle10g	oracle11gc                    W\        V4      ) ^,          ,          ,          pTp\        ^ \        V4      ^4       F"  p\        WAWU^,            4      p\        W4      pK$  	  V# )a  performs des-cbc encryption, returns only last block.

this performs a specific DES-CBC encryption implementation
as needed by the Oracle10 hash. it probably won't be useful for
other purposes as-is.

input value is null-padded to multiple of 8 bytes.

:arg key: des key as bytes
:arg value: value to encrypt, as bytes.
:param iv: optional IV
:param pad: optional pad byte

:returns: last block of DES-CBC encryption of all ``value``'s byte blocks.
)lenr   r   r   )keyvalueivpadhashoffsetchunks   &&&&   U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/handlers/oracle.pydes_cbc_encryptr      s[      
SZK!O$$ED3u:a($fAX 67 , ) K    s   #Egc                   Z   a  ] tR t^4t o RtR t]P                  t^t	]
R 4       tR tRtV tR# )oracle10a  This class implements the password hash used by Oracle up to version 10g, and follows the :ref:`password-hash-api`.

It does a single round of hashing, and relies on the username as the salt.

The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods all require the
following additional contextual keywords:

:type user: str
:param user: name of oracle user account this password is associated with.
c                "    VP                  4       # )N)upper)clsr   s   &&r   
_norm_hashoracle10._norm_hashI   s    zz|r   c                P   \        V\        4      '       d   VP                  R 4      p\        V P                  R RR7      pW!,           P                  4       P                  R4      p\        \        V4      p\        WC4      p\        V4      P                  R4      P                  4       # )utf-8user)paramz	utf-16-beascii)

isinstancebytesdecoder   r$   r   encoder   ORACLE10_MAGICr   )selfsecretr$   inputr   s   &&   r   _calc_checksumoracle10._calc_checksumM   s     fe$$]]7+F$))WF;##%,,[9~u5t+t}##G,2244r    N)__name__
__module____qualname____firstlineno____doc__nameuh	HEX_CHARSchecksum_charschecksum_sizeclassmethodr    r/   __static_attributes____classdictcell____classdict__s   @r   r   r   4   s=     	 D\\NM
  5 5r   r   c                      a  ] tR t^ht o RtR tRt^(t]P                  t
^;tt]P                  t]P                  ! ]! R4      ]P"                  4      t]R 4       tR tR tRtV tR# )	oracle11a  This class implements the Oracle11g password hash, and follows the :ref:`password-hash-api`.

It supports a fixed-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 20 hexadecimal characters.

: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/^S:(?P<chk>[0-9a-f]{40})(?P<salt>[0-9a-f]{20})$c                    \        VR R4      pV P                  P                  V4      pV'       g    \        P                  P                  V 4      hVP                  RR4      w  r4V ! W4P                  4       R7      # )r&   r   saltchk)rD   checksum)r   _hash_regexmatchr8   excInvalidHashErrorgroupr   )r   r   mrD   rE   s   &&   r   from_stringoracle11.from_string   s_    $0OO!!$'&&))#..GGFE*	yy{33r   c                    V P                   p\        R 4      VP                  4       V P                  P                  4       3,          p\	        V4      # )zS:%s%s)rF   r   r   rD   r	   )r,   rE   r   s   &  r   	to_stringoracle11.to_string   s:    mm{ciik499??+<==T""r   c                   \        V\        4      '       d   VP                  R 4      p\        V\	        V P
                  P                  R4      4      ,           4      P                  4       p\        V4      P                  4       # )r#   r&   )	r'   r
   r*   r   r   rD   	hexdigestr   r   )r,   r-   rE   s   && r   r/   oracle11._calc_checksum   s]    fg&&]]7+F6Idii&6&6w&?@@AKKMS!''))r   r1   N)rD   )r2   r3   r4   r5   r6   r7   setting_kwdsr;   r8   UPPER_HEX_CHARSr:   min_salt_sizemax_salt_size
salt_charsrecompiler   IrG   r<   rM   rP   r/   r=   r>   r?   s   @r   rB   rB   h   s}     4 DLM''N %'&MM##J **QPQSUSWSWXK4 4#
* *r   rB   )s               )#r6   binasciir   r   hashlibr   rZ   logging	getLoggerr2   logpasslib.utilsr   r   passlib.utils.compatr   r   r	   r
   r   passlib.crypto.desr   passlib.utils.handlersutilshandlersr8   __all__r   r+   HasUserContextStaticHandlerr   HasSaltGenericHandlerrB   r1   r   r   <module>rn      s    9
 (  	 g''1 0G G 0 # # 0 5+5r  ""2"2 +5h<*rzz2,, <*r   