https://t.me/AnonymousX5
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 :  /usr/lib64/python2.7/site-packages/nacl/bindings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/nacl/bindings/crypto_box.pyc
�
y�\c@`sddlmZmZmZddlmZddlmZm	Z	ddl
mZddgZe	j
�Ze	j�Ze	j�Ze	j�Ze	j�Ze	j�Ze	j�Ze	j�Zd�Zd�Zd	�Zd
�Z d�Z!d�Z"d
�Z#d�Z$d�Z%dS(i(tabsolute_importtdivisiontprint_function(t
exceptions(tffitlib(tensuretcrypto_box_keypairt
crypto_boxcC`svtjdt�}tjdt�}tj||�}t|dkddtj�tj	|t�tj	|t�fS(sq
    Returns a randomly generated public and secret key.

    :rtype: (bytes(public_key), bytes(secret_key))
    sunsigned char[]isUnexpected library errortraising(
Rtnewtcrypto_box_PUBLICKEYBYTEStcrypto_box_SECRETKEYBYTESRRRtexctRuntimeErrortbuffer(tpktsktrc((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR#s
cC`s�tt|t�ddt�t|�tkr@tjd��ntj	dt
�}tj	dt�}tj
|||�}t|dkddtj�tj|t
�tj|t�fS(s
    Returns a (public, secret) keypair deterministically generated
    from an input ``seed``.

    .. warning:: The seed **must** be high-entropy; therefore,
        its generator **must** be a cryptographic quality
        random function like, for example, :func:`~nacl.utils.random`.

    .. warning:: The seed **must** be protected and remain secret.
        Anyone who knows the seed is really in possession of
        the corresponding PrivateKey.


    :param seed: bytes
    :rtype: (bytes(public_key), bytes(secret_key))
    sseed must be bytesR	sInvalid seedsunsigned char[]isUnexpected library error(Rt
isinstancetbytest	TypeErrortlentcrypto_box_SEEDBYTESR
t
ValueErrorRR
RRRtcrypto_box_seed_keypairRR(tseedRRR((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR7s
cC`s�t|�tkr$tjd��nt|�tkrHtjd��nt|�tkrltjd��ndt|}tjdt|��}t	j
||t|�|||�}t|dkddtj�tj
|t|��tS(	s�
    Encrypts and returns a message ``message`` using the secret key ``sk``,
    public key ``pk``, and the nonce ``nonce``.

    :param message: bytes
    :param nonce: bytes
    :param pk: bytes
    :param sk: bytes
    :rtype: bytes
    sInvalid nonce sizesInvalid public keysInvalid secret keytsunsigned char[]isUnexpected library errorR	(Rtcrypto_box_NONCEBYTESR
RRRtcrypto_box_ZEROBYTESRR
RRRRRtcrypto_box_BOXZEROBYTES(tmessagetnonceRRtpaddedt
ciphertextR((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR]s$
cC`s�t|�tkr$tjd��nt|�tkrHtjd��nt|�tkrltjd��ndt|}tjdt|��}t	j
||t|�|||�}t|dkddtj�tj
|t|��tS(	s
    Decrypts and returns an encrypted message ``ciphertext``, using the secret
    key ``sk``, public key ``pk``, and the nonce ``nonce``.

    :param ciphertext: bytes
    :param nonce: bytes
    :param pk: bytes
    :param sk: bytes
    :rtype: bytes
    sInvalid nonce sizesInvalid public keysInvalid secret keyRsunsigned char[]is/An error occurred trying to decrypt the messageR	(RRR
RRRRRR
Rtcrypto_box_openRtCryptoErrorRR(R"R RRR!t	plaintexttres((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR#|s$
cC`s�t|�tkr$tjd��nt|�tkrHtjd��ntjdt�}tj	|||�}t
|dkddtj�tj|t�S(s
    Computes and returns the shared key for the public key ``pk`` and the
    secret key ``sk``. This can be used to speed up operations where the same
    set of keys is going to be used multiple times.

    :param pk: bytes
    :param sk: bytes
    :rtype: bytes
    sInvalid public keysInvalid secret keysunsigned char[]isUnexpected library errorR	(
RRR
RRRR
tcrypto_box_BEFORENMBYTESRtcrypto_box_beforenmRRR(RRtkR((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR(�s

cC`s�t|�tkr$tjd��nt|�tkrHtjd��ndt|}tjdt|��}tj	||t|�||�}t
|dkddtj�tj|t|��t
S(s�
    Encrypts and returns the message ``message`` using the shared key ``k`` and
    the nonce ``nonce``.

    :param message: bytes
    :param nonce: bytes
    :param k: bytes
    :rtype: bytes
    s
Invalid noncesInvalid shared keyRsunsigned char[]isUnexpected library errorR	(RRR
RR'RRR
Rtcrypto_box_afternmRRRR(RR R)R!R"R((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR*�s
!
cC`s�t|�tkr$tjd��nt|�tkrHtjd��ndt|}tjdt|��}tj	||t|�||�}t
|dkddtj�tj|t|��t
S(s�
    Decrypts and returns the encrypted message ``ciphertext``, using the shared
    key ``k`` and the nonce ``nonce``.

    :param ciphertext: bytes
    :param nonce: bytes
    :param k: bytes
    :rtype: bytes
    s
Invalid noncesInvalid shared keyRsunsigned char[]is/An error occurred trying to decrypt the messageR	(RRR
RR'RRR
Rtcrypto_box_open_afternmRR$RR(R"R R)R!R%R&((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR+�s

cC`s�tt|t�ddt�tt|t�ddt�t|�tkr\tjd��nt|�}t|}t	j
d|�}tj||||�}t|dkddtj
�t	j||�S(s�
    Encrypts and returns a message ``message`` using an ephemeral secret key
    and the public key ``pk``.
    The ephemeral public key, which is embedded in the sealed box, is also
    used, in combination with ``pk``, to derive the nonce needed for the
    underlying box construct.

    :param message: bytes
    :param pk: bytes
    :rtype: bytes

    .. versionadded:: 1.2
    sinput message must be bytesR	spublic key must be bytessInvalid public keysunsigned char[]isUnexpected library error(RRRRRRR
Rtcrypto_box_SEALBYTESRR
Rtcrypto_box_sealRR(RRt_mlent_clenR"R((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR-�s 

cC`stt|t�ddt�tt|t�ddt�tt|t�ddt�t|�tkrxtjd��nt|�tkr�tjd��nt|�}|t	}t
jd|�}tj
|||||�}t|dkd	dtj�t
j||�S(
s�
    Decrypts and returns an encrypted message ``ciphertext``, using the
    recipent's secret key ``sk`` and the sender's ephemeral public key
    embedded in the sealed box. The box contruct nonce is derived from
    the recipient's public key ``pk`` and the sender's public key.

    :param ciphertext: bytes
    :param pk: bytes
    :param sk: bytes
    :rtype: bytes

    .. versionadded:: 1.2
    sinput ciphertext must be bytesR	spublic key must be bytesssecret key must be bytessInvalid public keysInvalid secret keysunsigned char[]is/An error occurred trying to decrypt the message(RRRRRRR
RRR,RR
Rtcrypto_box_seal_openR$R(R"RRR/R.R%R&((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyR0s(

N(&t
__future__RRRtnaclRR
tnacl._sodiumRRtnacl.exceptionsRt__all__tcrypto_box_secretkeybytesRtcrypto_box_publickeybytesRtcrypto_box_seedbytesRtcrypto_box_noncebytesRtcrypto_box_zerobytesRtcrypto_box_boxzerobytesRtcrypto_box_beforenmbytesR'tcrypto_box_sealbytesR,RRRR#R(R*R+R-R0(((s:/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_box.pyt<module>s*		&						&

https://t.me/AnonymousX5 - 2025