|
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 : /lib64/python2.7/site-packages/nacl/bindings/ |
Upload File : |
�
y�\c @` s� d d l m Z m Z m Z d d l m Z d d l m Z m Z d d l
m Z e j � Z
e j � Z e j � Z e j � Z e j � Z e j � Z d � Z d � Z d S( i ( t absolute_importt divisiont print_function( t
exceptions( t ffit lib( t ensurec C` s� t | � t k r$ t j d � � n t | � t k rH t j d � � n d t | } t j d t | � � } t j | | t | � | | � } t
| d k d d t j �t j | t | � � } | t
S( s�
Encrypts and returns the message ``message`` with the secret ``key`` and
the nonce ``nonce``.
:param message: bytes
:param nonce: bytes
:param key: bytes
:rtype: bytes
s Invalid keys
Invalid noncet s unsigned char[]i s Encryption failedt raising( t lent crypto_secretbox_KEYBYTESt exct
ValueErrort crypto_secretbox_NONCEBYTESt crypto_secretbox_ZEROBYTESR t newR t crypto_secretboxR t CryptoErrort buffert crypto_secretbox_BOXZEROBYTES( t messaget noncet keyt paddedt
ciphertextt res( ( s@ /tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_secretbox.pyR s
!c C` s� t | � t k r$ t j d � � n t | � t k rH t j d � � n d t | } t j d t | � � } t j | | t | � | | � } t
| d k d d t j �t j | t | � � } | t
S( s�
Decrypt and returns the encrypted message ``ciphertext`` with the secret
``key`` and the nonce ``nonce``.
:param ciphertext: bytes
:param nonce: bytes
:param key: bytes
:rtype: bytes
s Invalid keys
Invalid nonceR s unsigned char[]i s1 Decryption failed. Ciphertext failed verificationR ( R R
R R R
R R R R t crypto_secretbox_openR R R R ( R R R R t plaintextR ( ( s@ /tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_secretbox.pyR 8 s
N( t
__future__R R R t naclR R t nacl._sodiumR R t nacl.exceptionsR t crypto_secretbox_keybytesR
t crypto_secretbox_noncebytesR
t crypto_secretbox_zerobytesR t crypto_secretbox_boxzerobytesR t crypto_secretbox_macbytest crypto_secretbox_MACBYTESt! crypto_secretbox_messagebytes_maxt! crypto_secretbox_MESSAGEBYTES_MAXR R ( ( ( s@ /tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_secretbox.pyt <module> s