403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/_mode_cbc.cpython-311.pyc
�

8�tc�*���dZdgZddlmZddlmZmZmZmZm	Z	m
Z
mZmZddl
mZedd��ZGd�de��Zd	�Zd
S)z'
Ciphertext Block Chaining (CBC) mode.
�CbcMode�)�_copy_bytes)�load_pycryptodome_raw_lib�VoidPointer�create_string_buffer�get_raw_buffer�SmartPointer�c_size_t�c_uint8_ptr�is_writeable_buffer)�get_random_byteszCryptodome.Cipher._raw_cbca�
                int CBC_start_operation(void *cipher,
                                        const uint8_t iv[],
                                        size_t iv_len,
                                        void **pResult);
                int CBC_encrypt(void *cbcState,
                                const uint8_t *in,
                                uint8_t *out,
                                size_t data_len);
                int CBC_decrypt(void *cbcState,
                                const uint8_t *in,
                                uint8_t *out,
                                size_t data_len);
                int CBC_stop_operation(void *state);
                c�(�eZdZdZd�Zdd�Zdd�ZdS)ra[*Cipher-Block Chaining (CBC)*.

    Each of the ciphertext blocks depends on the current
    and all previous plaintext blocks.

    An Initialization Vector (*IV*) is required.

    See `NIST SP800-38A`_ , Section 6.2 .

    .. _`NIST SP800-38A` : http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf

    :undocumented: __init__
    c	�Z�t��|_t�|���t|��t
t|����|j�����}|rtd|z���t|j���tj��|_|���t|��|_
	tdd|��|_	|j|_	|j|jg|_dS)aCreate a new block cipher, configured in CBC mode.

        :Parameters:
          block_cipher : C pointer
            A smart pointer to the low-level block cipher instance.

          iv : bytes/bytearray/memoryview
            The initialization vector to use for encryption or decryption.
            It is as long as the cipher block.

            **The IV must be unpredictable**. Ideally it is picked randomly.

            Reusing the *IV* for encryptions performed with the same key
            compromises confidentiality.
        z)Error %d while instantiating the CBC modeN)r�_state�raw_cbc_lib�CBC_start_operation�getrr
�len�
address_of�
ValueErrorr	�CBC_stop_operation�release�
block_sizer�iv�IV�encrypt�decrypt�_next)�self�block_cipherr�results    �=/usr/lib/python3/dist-packages/Cryptodome/Cipher/_mode_cbc.py�__init__zCbcMode.__init__Ns
��""�m�m����0�0��1A�1A�1C�1C�1<�R���19�#�b�'�'�1B�1B�15��1G�1G�1I�1I�K�K���	'��H�%�&�'�'�
'�
#�4�;�?�?�#4�#4�#.�#A�C�C���
	�������b�'�'���@��d�D�"�-�-���	&��'�����|�T�\�3��
�
�
�Nc
��|j|jvrtd���|jg|_|�tt	|����}n_|}t|��std���t	|��t	|��krt
dt	|��z���t�|j	�
��t|��t|��tt	|������}|r/|dkrt
d|j
z���t
d|z���|�t|��SdS)a�Encrypt data with the key and the parameters set at initialization.

        A cipher object is stateful: once you have encrypted a message
        you cannot encrypt (or decrypt) another message using the same
        object.

        The data to encrypt can be broken up in two or
        more pieces and `encrypt` can be called multiple times.

        That is, the statement:

            >>> c.encrypt(a) + c.encrypt(b)

        is equivalent to:

             >>> c.encrypt(a+b)

        That also means that you cannot reuse an object for encrypting
        or decrypting other data with the same key.

        This function does not add any padding to the plaintext.

        :Parameters:
          plaintext : bytes/bytearray/memoryview
            The piece of data to encrypt.
            Its lenght must be multiple of the cipher block size.
        :Keywords:
          output : bytearray/memoryview
            The location where the ciphertext must be written to.
            If ``None``, the ciphertext is returned.
        :Return:
          If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
          Otherwise, ``None``.
        z*encrypt() cannot be called after decrypt()N�4output must be a bytearray or a writeable memoryview�9output must have the same length as the input  (%d bytes)��3Data must be padded to %d byte boundary in CBC modez%Error %d while encrypting in CBC mode)rr�	TypeErrorrrrrr�CBC_encryptrrrr
rr)r�	plaintext�output�
ciphertextr!s     r"rzCbcMode.encrypt}sT��H�<�t�z�)�)��H�I�I�I��|�%��
��>�-�c�)�n�n�=�=�J�J��J�&�v�.�.�
X�� V�W�W�W��9�~�~��V���,�,� �"0�25�i�.�.�"A�B�B�B��(�(�����):�):�)4�Y�)?�)?�)4�Z�)@�)@�)1�#�i�.�.�)A�)A�C�C���	O���{�{� �!V�Y]�Yh�!h�i�i�i��D�v�M�N�N�N��>�!�*�-�-�-��4r$c
��|j|jvrtd���|jg|_|�tt	|����}n_|}t|��std���t	|��t	|��krt
dt	|��z���t�|j	�
��t|��t|��tt	|������}|r/|dkrt
d|j
z���t
d|z���|�t|��SdS)aDecrypt data with the key and the parameters set at initialization.

        A cipher object is stateful: once you have decrypted a message
        you cannot decrypt (or encrypt) another message with the same
        object.

        The data to decrypt can be broken up in two or
        more pieces and `decrypt` can be called multiple times.

        That is, the statement:

            >>> c.decrypt(a) + c.decrypt(b)

        is equivalent to:

             >>> c.decrypt(a+b)

        This function does not remove any padding from the plaintext.

        :Parameters:
          ciphertext : bytes/bytearray/memoryview
            The piece of data to decrypt.
            Its length must be multiple of the cipher block size.
        :Keywords:
          output : bytearray/memoryview
            The location where the plaintext must be written to.
            If ``None``, the plaintext is returned.
        :Return:
          If ``output`` is ``None``, the plaintext is returned as ``bytes``.
          Otherwise, ``None``.
        z*decrypt() cannot be called after encrypt()Nr&r'r(r)z%Error %d while decrypting in CBC mode)rrr*rrrrr�CBC_decryptrrrr
rr)rr.r-r,r!s     r"rzCbcMode.decrypt�sT��B�<�t�z�)�)��H�I�I�I��|�%��
��>�,�S��_�_�=�=�I�I��I�&�v�.�.�
X�� V�W�W�W��:���#�f�+�+�-�-� �"0�25�i�.�.�"A�B�B�B��(�(�����):�):�)4�Z�)@�)@�)4�Y�)?�)?�)1�#�j�/�/�)B�)B�D�D���	O���{�{� �!V�Y]�Yh�!h�i�i�i��D�v�M�N�N�N��>�!�)�,�,�,��4r$)N)�__name__�
__module__�__qualname__�__doc__r#rr�r$r"rr?s[��������-4�-4�-4�^@�@�@�@�D=�=�=�=�=�=r$c��|�|��}|�dd��}|�dd��}d||fkrt|j��}|�|�t	d���n|}t|��|jkrt
d|jz���|rt	dt|��z���t||��S)a�Instantiate a cipher object that performs CBC encryption/decryption.

    :Parameters:
      factory : module
        The underlying block cipher, a module from ``Cryptodome.Cipher``.

    :Keywords:
      iv : bytes/bytearray/memoryview
        The IV to use for CBC.

      IV : bytes/bytearray/memoryview
        Alias for ``iv``.

    Any other keyword will be passed to the underlying block cipher.
    See the relevant documentation for details (at least ``key`` will need
    to be present).
    rNr)NNz*You must either use 'iv' or 'IV', not bothz.Incorrect IV length (it must be %d bytes long)zUnknown parameters for CBC: %s)	�_create_base_cipher�popr
rr*rr�strr)�factory�kwargs�cipher_staterrs     r"�_create_cbc_cipherr=�s���&�.�.�v�6�6�L�	���D�$�	�	�B�	���D�$�	�	�B���B�x���
�g�0�
1�
1��	�~�
�>��H�I�I�I����
�2�w�w�'�$�$�$��I��"�#�$�$�	$��H��8�3�v�;�;�F�G�G�G��<��$�$�$r$N)r4�__all__�Cryptodome.Util.py3compatr�Cryptodome.Util._raw_apirrrrr	r
rr�Cryptodome.Randomr
r�objectrr=r5r$r"�<module>rCs	��>���+��1�1�1�1�1�1�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�
/�.�.�.�.�.�'�'�(D�G����$}�}�}�}�}�f�}�}�}�@&%�&%�&%�&%�&%r$

Youez - 2016 - github.com/yon3zu
LinuXploit