o
    j                     @   sD   d dl mZmZmZ d dlmZ d dlmZmZ G dd deZ	dS )    )Cipher
algorithmsmodes)default_backend)symmetricBASE
cipherMODEc                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
RC4c                 C   s   d | _ d | _t| | d S N)	encryptor	decryptorr   __init__)selfkey r   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/unicrypto/backends/cryptography/RC4.pyr      s   zRC4.__init__c                 C   s:   t | j}t|d t d| _| j | _| j | _d S )N)modebackend)r   ARC4r   r   r   _cipherr
   r   )r   	algorithmr   r   r   setup_cipher   s   zRC4.setup_cipherc                 C      | j |S r	   )r
   updater   datar   r   r   encrypt      zRC4.encryptc                 C   r   r	   )r   r   r   r   r   r   decrypt   r   zRC4.decryptN)__name__
__module____qualname__r   r   r   r   r   r   r   r   r      s
    r   N)
&cryptography.hazmat.primitives.ciphersr   r   r   cryptography.hazmat.backendsr   unicrypto.symmetricr   r   r   r   r   r   r   <module>   s   