B
    è¹`Ø  ã               @   sn   d Z yddlmZ dd„ ZeZW n< ek
r\   ddlmZ ddlm	Z	 dd„ Zdd	„ ZY nX d
Z
dd„ ZdS )z2Encryption module that uses pycryptopp or pycryptoé    )Úaesc             C   s   t  |¡}| | ¡S )N)r   ÚAESÚprocess)ÚdataÚkeyÚcipher© r   ú^/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/beaker/crypto/pycrypto.pyÚ
aesEncrypt	   s    
r
   )r   )ÚCounterc             C   s&   t j|t jtjdddd}| | ¡S )Né€   r   )Úinitial_value)Úcounter)r   ÚnewÚMODE_CTRr   Zencrypt)r   r   r   r   r   r	   r
      s    
c             C   s&   t j|t jtjdddd}| | ¡S )Nr   r   )r   )r   )r   r   r   r   Zdecrypt)r   r   r   r   r   r	   Ú
aesDecrypt   s    
r   Tc               C   s   dS )Né    r   r   r   r   r	   ÚgetKeyLength!   s    r   N)Ú__doc__Zpycryptopp.cipherr   r
   r   ÚImportErrorZCrypto.Cipherr   ZCrypto.Utilr   Zhas_aesr   r   r   r   r	   Ú<module>   s   