403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/_mode_cfb.cpython-312.pyc
�

��e�)��|�dZdgZddlmZddlmZmZmZmZm	Z	m
Z
mZmZddl
mZedd�ZGd�de�Zd	�Zy
)z
Counter Feedback (CFB) mode.
�CfbMode�)�_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_cfba 
                    int CFB_start_operation(void *cipher,
                                            const uint8_t iv[],
                                            size_t iv_len,
                                            size_t segment_len, /* In bytes */
                                            void **pResult);
                    int CFB_encrypt(void *cfbState,
                                    const uint8_t *in,
                                    uint8_t *out,
                                    size_t data_len);
                    int CFB_decrypt(void *cfbState,
                                    const uint8_t *in,
                                    uint8_t *out,
                                    size_t data_len);
                    int CFB_stop_operation(void *state);c�&�eZdZdZd�Zdd�Zdd�Zy)ra�*Cipher FeedBack (CFB)*.

    This mode is similar to CFB, but it transforms
    the underlying block cipher into a stream cipher.

    Plaintext and ciphertext are processed in *segments*
    of **s** bits. The mode is therefore sometimes
    labelled **s**-bit CFB.

    An Initialization Vector (*IV*) is required.

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

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

    :undocumented: __init__
    c	��t�|_tj|j	�t|�t
t|��t
|�|jj��}|rtd|z��t|jj	�tj�|_|j�t|�|_
	tdd|�|_	|j|_	ddg|_y)a�Create a new block cipher, configured in CFB 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.

          segment_size : integer
            The number of bytes the plaintext and ciphertext are segmented in.
        z)Error %d while instantiating the CFB modeN�encrypt�decrypt)r�_state�raw_cfb_lib�CFB_start_operation�getrr
�len�
address_of�
ValueErrorr	�CFB_stop_operation�release�
block_sizer�iv�IV�_next)�self�block_cipherr�segment_size�results     �=/usr/lib/python3/dist-packages/Cryptodome/Cipher/_mode_cfb.py�__init__zCfbMode.__init__Js���("�m����0�0��1A�1A�1C�1<�R��19�#�b�'�1B�19�,�1G�15���1G�1G�1I�	K��
��H�6�Q�R�R�#�4�;�;�?�?�#4�#.�#A�#A�C���
	�����b�'���@��d�D�"�-���	&��'�'������+��
�Nc
���d|jvrtd��dg|_|�tt|��}nF|}t	|�std��t|�t|�k7rtdt|�z��tj|jj�t|�t|�tt|���}|rtd|z��|�t|�Sy)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)

        This function does not add any padding to the plaintext.

        :Parameters:
          plaintext : bytes/bytearray/memoryview
            The piece of data to encrypt.
            It can be of any length.
        :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``.
        rz*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)z%Error %d while encrypting in CFB mode)
r�	TypeErrorrrrrr�CFB_encryptrrrr
r)r�	plaintext�output�
ciphertextr"s     r#rzCfbMode.encrypt|s���B�D�J�J�&��H�I�I��[��
��>�-�c�)�n�=�J��J�&�v�.�� V�W�W��9�~��V��,� �"0�25�i�.�"A�B�B��(�(������):�)4�Y�)?�)4�Z�)@�)1�#�i�.�)A�C����D�v�M�N�N��>�!�*�-�-�r%c
���d|jvrtd��dg|_|�tt|��}nF|}t	|�std��t|�t|�k7rtdt|�z��tj|jj�t|�t|�tt|���}|rtd|z��|�t|�Sy)a�Decrypt 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.
            It can be of any length.
        :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``.
        rz*decrypt() cannot be called after encrypt()Nr'r(z%Error %d while decrypting in CFB mode)
rr)rrrrr�CFB_decryptrrrr
r)rr-r,r+r"s     r#rzCfbMode.decrypt�s���B�D�J�J�&��H�I�I��[��
��>�,�S��_�=�I��I�&�v�.�� V�W�W��:��#�f�+�-� �"0�25�i�.�"A�B�B��(�(������):�)4�Z�)@�)4�Y�)?�)1�#�j�/�)B�D����D�v�M�N�N��>�!�)�,�,�r%)N)�__name__�
__module__�__qualname__�__doc__r$rr�r%r#rr7s���$0,�d;�z;r%c���|j|�}|jdd�}|jdd�}d||fk(rt|j�}|�
|�
t	d��|}t|�|jk7rt
d|jz��t|jdd�d�\}}|d	k(s|d	k7rt
d
��|rt	dt|�z��t|||�S)a�Instantiate a cipher object that performs CFB encryption/decryption.

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

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

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

      segment_size : integer
        The number of bit the plaintext and ciphertext are segmented in.
        If not present, the default is 8.

    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)r!�rz6'segment_size' must be positive and multiple of 8 bitszUnknown parameters for CFB: %s)
�_create_base_cipher�popr
rr)rr�divmod�strr)�factory�kwargs�cipher_staterr�segment_size_bytes�rems       r#�_create_cfb_cipherr@�s���.�.�.�v�6�L�	���D�$�	�B�	���D�$�	�B���B�x��
�g�0�0�
1��	�~�
�>��H�I�I�
��
�2�w�'�$�$�$��I��"�"�#�$�	$�%�V�Z�Z���%B�A�F�����Q��#��(��Q�R�R�
��8�3�v�;�F�G�G��<��%7�8�8r%N)r3�__all__�Cryptodome.Util.py3compatr�Cryptodome.Util._raw_apirrrrr	r
rr�Cryptodome.Randomr
r�objectrr@r4r%r#�<module>rFsQ��.��+��1�7�7�7�
/�'�(D�F<���$}�f�}�@.9r%

Youez - 2016 - github.com/yon3zu
LinuXploit