|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib/python3.7/site-packages/beaker/crypto/__pycache__/ |
Upload File : |
B
��[B � @ sN d Z ddlZej�� ejjZdej�e� Zdd� Zdd� Z dZ
d d
� ZdS )z%Encryption module that uses nsscrypto� N� c C sv t j �t�}t j �|tt j jt j jt j �|��}t j �tt j �t��}t j � tt j j||�}|�
| �}|�� }|| S )N)�nss�
get_best_slot�_mech�import_sym_key�PK11_OriginGeneratedZCKA_ENCRYPT�SecItem�
param_from_iv�_iv�create_context_by_sym_key� cipher_op�digest_final)�data�key�slot�key_obj�param�ctx�l1�l2� r �H/opt/alt/python37/lib/python3.7/site-packages/beaker/crypto/nsscrypto.py�
aesEncrypt s
r c C sv t j �t�}t j �|tt j jt j jt j �|��}t j �tt j �t��}t j � tt j j||�}|�
| �}|�� }|| S )N)r r r r r ZCKA_DECRYPTr r r
r r r
)r r r r r r r r r r r �
aesDecrypt s
r Tc C s dS )N� r r r r r �getKeyLength. s r )�__doc__Znss.nssr Z
nss_init_nodbZCKM_AES_CBC_PADr Z
get_iv_lengthr
r r Zhas_aesr r r r r �<module> s