| Server IP : 217.160.0.135 / Your IP : 216.73.216.115 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 : /lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/ |
Upload File : |
�
8�tc0 � � � d dl mZ d dlmZmZmZmZmZmZm Z edd� � Z
G d� d� � Zd� ZdZ
ed d
� � ZdS )� )�b)�load_pycryptodome_raw_lib�VoidPointer�create_string_buffer�get_raw_buffer�SmartPointer�c_size_t�c_uint8_ptrzCryptodome.Cipher._ARC4al
int ARC4_stream_encrypt(void *rc4State, const uint8_t in[],
uint8_t out[], size_t len);
int ARC4_stream_init(uint8_t *key, size_t keylen,
void **pRc4State);
int ARC4_stream_destroy(void *rc4State);
c �$ � e Zd ZdZd� Zd� Zd� ZdS )�
ARC4CipherzgARC4 cipher object. Do not create it directly. Use
:func:`Cryptodome.Cipher.ARC4.new` instead.
c �� � t |� � dk r|d }|dd� }n|� dd� � }t |� � t vrt dt |� � z � � �t � � | _ t � t |� � t t |� � � � | j �
� � � � }|dk rt d|z � � �t | j � � � t j
� � | _ |dk r| � d|z � � d| _ t |� � | _ dS )zOInitialize an ARC4 cipher object
See also `new()` at the module level.r � N�dropz$Incorrect ARC4 key length (%d bytes)z'Error %d while creating the ARC4 cipher� )�len�pop�key_size�
ValueErrorr �_state�
_raw_arc4_lib�ARC4_stream_initr
r �
address_ofr �get�ARC4_stream_destroy�encrypt�
block_size)�self�key�args�kwargs�ndrop�results �8/usr/lib/python3/dist-packages/Cryptodome/Cipher/ARC4.py�__init__zARC4Cipher.__init__, sL � �
�t�9�9�q�=�=���G�E�����8�D�D��J�J�v�q�)�)�E��s�8�8�8�#�#��C� ��X�X�&� '� '�
'� "�m�m����/�/��C�0@�0@�08��S���0B�0B�04��0F�0F�0H�0H�J� J�� �Q�;�;��F�%�&� '� '�
'�"�4�;�?�?�#4�#4�#0�#D�F� F��� �1�9�9�
�L�L��5��)�)�)�����C����
�
�
� c
�6 � t t |� � � � }t � | j � � � t
|� � |t t |� � � � � � }|rt d|z � � �t |� � S )z�Encrypt a piece of data.
:param plaintext: The data to encrypt, of any size.
:type plaintext: bytes, bytearray, memoryview
:returns: the encrypted byte string, of equal length as the
plaintext.
z"Error %d while encrypting with RC4)
r r r �ARC4_stream_encryptr r r
r r r )r � plaintext�
ciphertextr"