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_openpgp.cpython-312.pyc
�

��e���B�dZdgZddlmZddlmZGd�de�Zd�Zy)z
OpenPGP mode.
�OpenPgpMode�)�_copy_bytes)�get_random_bytesc�"�eZdZdZd�Zd�Zd�Zy)razOpenPGP mode.

    This mode is a variant of CFB, and it is only used in PGP and
    OpenPGP_ applications. If in doubt, use another mode.

    An Initialization Vector (*IV*) is required.

    Unlike CFB, the *encrypted* IV (not the IV itself) is
    transmitted to the receiver.

    The IV is a random data block. For legacy reasons, two of its bytes are
    duplicated to act as a checksum for the correctness of the key, which is now
    known to be insecure and is ignored. The encrypted IV is therefore 2 bytes
    longer than the clean IV.

    .. _OpenPGP: http://tools.ietf.org/html/rfc4880

    :undocumented: __init__
    c��|j|_d|_|j||jfd|jz|jdzd�|��}t	dd|�}t|�|jk(r|j
||ddz�|_n^t|�|jdzk(r||_|j|�dd}n'td|j|jdzfz��|x|_
|_|j||jf|j|jd|jdzd�|��|_y)NF��)�IV�segment_size����z4Length of IV must be %d or %d bytes for MODE_OPENPGP)
�
block_size�_done_first_block�new�MODE_CFBr�len�encrypt�
_encrypted_IV�decrypt�
ValueError�ivr
�_cipher)�self�factory�keyr�
cipher_params�	IV_ciphers      �A/usr/lib/python3/dist-packages/Cryptodome/Cipher/_mode_openpgp.py�__init__zOpenPgpMode.__init__=si��"�,�,���!&��� �G�K�K���(�(�)�#�T�_�_�4�%)�_�_�q�%8�	)�
(�)�	���t�R�
(���r�7�d�o�o�%�!*�!2�!2�2��2�3��<�!@�D��
��W����!�+�
+�!#�D���"�"�2�&�s��+�B��1� $������1�1D�E�F�G�
G�����$�'�#�w�{�{��#�,�,�-� $�1�1�4�?�?�2B�2C�D�)-���1�)<�	-�
,�-���c��|jj|�}|js|j|z}d|_|S)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.

        :Return:
            the encrypted data, as a byte string.
            It is as long as *plaintext* with one exception:
            when encrypting the first message chunk,
            the encypted IV is prepended to the returned ciphertext.
        T)rrrr)r�	plaintext�ress   rrzOpenPgpMode.encryptgs>��>�l�l�"�"�9�-���%�%��$�$�s�*�C�%)�D�"��
r c�8�|jj|�S)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.

        :Return: the decrypted data (byte string).
        )rr)r�
ciphertexts  rrzOpenPgpMode.decrypt�s��6�|�|�#�#�J�/�/r N)�__name__�
__module__�__qualname__�__doc__rrr�r rrr(s���((-�T#�J0r c�4�|jdd�}|jdd�}d||fk(rt|j�}|�
|�
td��|}	|jd�}t
||||�S#t$r}tdt|�z��d}~wwxYw)a#Create a new block cipher, configured in OpenPGP mode.

    :Parameters:
      factory : module
        The module.

    :Keywords:
      key : bytes/bytearray/memoryview
        The secret key to use in the symmetric cipher.

      IV : bytes/bytearray/memoryview
        The initialization vector to use for encryption or decryption.

        For encryption, the IV must be as long as the cipher block size.

        For decryption, it must be 2 bytes longer (it is actually the
        *encrypted* IV which was prefixed to the ciphertext).
    r
Nr)NNz*You must either use 'iv' or 'IV', not bothrzMissing component: )�poprr�	TypeError�KeyError�strr)r�kwargsrr
r�es      r�_create_openpgp_cipherr2�s���(
���D�$�	�B�	���D�$�	�B���B�x��
�g�0�0�
1��	�~�
�>��H�I�I�
��8��j�j�����w��R��0�0���8��-��A��6�7�7��8�s�A2�2	B�;B�BN)	r)�__all__�Cryptodome.Util.py3compatr�Cryptodome.Randomr�objectrr2r*r r�<module>r7s-��>��/��1�.�0�&�0�D$1r 

Youez - 2016 - github.com/yon3zu
LinuXploit