+
    rpÐjX/  ã                   ó¢   € ^ RI HtHt ^ RIt^ RIHt ^ RIHt ^ RIH	t	H
t
Ht  ! R R]P                  ]
4      t ! R R	]P                  ]
4      tR# )
é    )ÚClassVarÚOptionalN)Úencoding)Ú
exceptions)ÚEncryptedMessageÚStringFixerÚrandomc                   óz  a € ] tR t^t o Rt]P                  P                  t]P                  P                  t
]P                  P                  t]P                  P                  t]P                   3V 3R lR lltV 3R lR ltR]P                   3V 3R lR lltR]P                   3V 3R	 lR
 lltV 3R ltRtV tR# )Ú	SecretBoxuû  
The SecretBox class encrypts and decrypts messages using the given secret
key.

The ciphertexts generated by :class:`~nacl.secret.Secretbox` include a 16
byte authenticator which is checked as part of the decryption. An invalid
authenticator will cause the decrypt function to raise an exception. The
authenticator is not a signature. Once you've decrypted the message you've
demonstrated the ability to create arbitrary valid message, so messages you
send are repudiable. For non-repudiable messages, sign them after
encryption.

Encryption is done using `XSalsa20-Poly1305`_, and there are no practical
limits on the number or size of messages (up to 2â�¶â�´ messages, each up to 2â�¶â�´
bytes).

.. _XSalsa20-Poly1305: https://doc.libsodium.org/secret-key_cryptography/secretbox#algorithm-details

:param key: The secret key used to encrypt and decrypt messages
:param encoder: The encoder class used to decode the given key

:cvar KEY_SIZE: The size that the key is required to be.
:cvar NONCE_SIZE: The size that the nonce is required to be.
:cvar MACBYTES: The size of the authentication MAC tag in bytes.
:cvar MESSAGEBYTES_MAX: The maximum size of a message which can be
                        safely encrypted with a single key/nonce
                        pair.
c                ó:   <€ V ^8„  d   QhRS[ RS[P                  /# ©é   ÚkeyÚencoder©Úbytesr   ÚEncoder)ÚformatÚ__classdict__s   "€Ú=/opt/hermes/.venv/lib/python3.14/site-packages/nacl/secret.pyÚ__annotate__ÚSecretBox.__annotate__;   s#   ø€ ÷ ñ ÙðÙ#+×#3Ñ#3ñó    c                ó  € VP                  V4      p\        V\        4      '       g   \        P                  ! R 4      h\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      hWn        R# )z'SecretBox must be created from 32 bytesú%The key must be exactly %s bytes longN©	ÚdecodeÚ
isinstancer   ÚexcÚ	TypeErrorÚlenÚKEY_SIZEÚ
ValueErrorÚ_key©Úselfr   r   s   &&&r   Ú__init__ÚSecretBox.__init__;   sc   € ð �n‰n˜SÓ!ˆÜ˜#œu×%Ò%Ü—-’-Ð IÓJÐJäˆs‹8�t—}‘}Ô$Ü—.’.Ø7¸$¿-¹-ÕGóð ð Ž	r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   Úreturn©r   )r   r   s   "€r   r   r   I   ó   ø€ ÷ ñ ™5ñ r   c                ó   € V P                   # ©N©r$   ©r&   s   &r   Ú	__bytes__ÚSecretBox.__bytes__I   ó   € Ø�y‰yÐr   Nc                óV   <€ V ^8„  d   QhRS[ RS[S[ ,          RS[P                  RS[/# )r   Ú	plaintextÚnoncer   r+   ©r   r   r   r   r   )r   r   s   "€r   r   r   L   s=   ø€ ÷ )
ñ )
áð)
ñ ™�ð)
ñ ×!Ñ!ð	)
ñ
 
ñ)
r   c                ó¨  € Vf   \        V P                  4      p\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      h\
        P                  P                  WV P                  4      pVP                  V4      pVP                  V4      p\        P                  ! VVVP                  W$,           4      4      # )aä  
Encrypts the plaintext message using the given `nonce` (or generates
one randomly if omitted) and returns the ciphertext encoded with the
encoder.

.. warning:: It is **VITALLY** important that the nonce is a nonce,
    i.e. it is a number used only once for any given key. If you fail
    to do this, you compromise the privacy of the messages encrypted.
    Give your nonces a different prefix, or have one side use an odd
    counter and one an even counter. Just make sure they are different.

:param plaintext: [:class:`bytes`] The plaintext message to encrypt
:param nonce: [:class:`bytes`] The nonce to use in the encryption
:param encoder: The encoder to use to encode the ciphertext
:rtype: [:class:`nacl.utils.EncryptedMessage`]
ú'The nonce must be exactly %s bytes long)r	   Ú
NONCE_SIZEr!   r   r#   ÚnaclÚbindingsÚcrypto_secretbox_easyr$   Úencoder   Ú_from_parts)r&   r6   r7   r   Ú
ciphertextÚencoded_nonceÚencoded_ciphertexts   &&&&   r   ÚencryptÚSecretBox.encryptL   sª   € ð, Š=Ü˜4Ÿ?™?Ó+ˆEäˆu‹:˜Ÿ™Ô(Ü—.’.Ø9¸D¿O¹OÕKóð ô —]‘]×8Ñ8Ø˜dŸi™ió
ˆ
ð  Ÿ™ uÓ-ˆØ$Ÿ^™^¨JÓ7Ðä×+Ò+ØØØ�N‰N˜5Õ-Ó.ó
ð 	
r   c                óV   <€ V ^8„  d   QhRS[ RS[S[ ,          RS[P                  RS[ /# )r   rA   r7   r   r+   ©r   r   r   r   )r   r   s   "€r   r   r   w   s=   ø€ ÷ "ñ "áð"ñ ™�ð"ñ ×!Ñ!ð	"ñ
 
ñ"r   c                ó@  € VP                  V4      pVf   VRV P                   pWP                  R p\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      h\
        P                  P                  WV P                  4      pV# ©a™  
Decrypts the ciphertext using the `nonce` (explicitly, when passed as a
parameter or implicitly, when omitted, as part of the ciphertext) and
returns the plaintext message.

:param ciphertext: [:class:`bytes`] The encrypted message to decrypt
:param nonce: [:class:`bytes`] The nonce used when encrypting the
    ciphertext
:param encoder: The encoder used to decode the ciphertext.
:rtype: [:class:`bytes`]
Nr:   )	r   r;   r!   r   r#   r<   r=   Úcrypto_secretbox_open_easyr$   )r&   rA   r7   r   r6   s   &&&& r   ÚdecryptÚSecretBox.decryptw   s‹   € ð$ —^‘^ JÓ/ˆ
àŠ=àÐ0 §¡Ð1ˆEØ#§O¡OÐ$5Ð6ˆJäˆu‹:˜Ÿ™Ô(Ü—.’.Ø9¸D¿O¹OÕKóð ô —M‘M×<Ñ<Ø˜tŸy™yó
ˆ	ð Ðr   c                óŠ   <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   # )r   r"   r;   ÚMACBYTESÚMESSAGEBYTES_MAX)r   Úint)r   r   s   "€r   r   r      sO   ø‡ ‚ ñ< ‘s�mÑEñ= ñ> ™•ÑIñ? ñ@ ‘s�mÑEñA ñB ™s•mñ òC r   r0   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r<   r=   Úcrypto_secretbox_KEYBYTESr"   Úcrypto_secretbox_NONCEBYTESr;   Úcrypto_secretbox_MACBYTESrN   Ú!crypto_secretbox_MESSAGEBYTES_MAXrO   r   Ú
RawEncoderr'   r2   rD   rK   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s£   ø‡ € ñð: #Ÿm™m×EÑE€HØ $§¡× IÑ I€JØ"Ÿm™m×EÑE€Hà�‰×7Ñ7ð ð
 7?×6IÑ6I÷ò ÷ð ð "&Ø$,×$7Ñ$7÷	)
ò )
ð\ "&Ø$,×$7Ñ$7÷	"ò "÷C ƒ r   r   c                   ór  a € ] tR t^œt o Rt]P                  P                  t]P                  P                  t
]P                  P                  t]P                  P                  t]P                   3V 3R lR lltV 3R lR ltRR]P                   3V 3R lR	 lltRR]P                   3V 3R
 lR lltRtV tR# )ÚAeadu…  
The AEAD class encrypts and decrypts messages using the given secret key.

Unlike :class:`~nacl.secret.SecretBox`, AEAD supports authenticating
non-confidential data received alongside the message, such as a length
or type tag.

Like :class:`~nacl.secret.Secretbox`, this class provides authenticated
encryption. An inauthentic message will cause the decrypt function to raise
an exception.

Likewise, the authenticator should not be mistaken for a (public-key)
signature: recipients (with the ability to decrypt messages) are capable of
creating arbitrary valid message; in particular, this means AEAD messages
are repudiable. For non-repudiable messages, sign them after encryption.

The cryptosystem used is `XChacha20-Poly1305`_ as specified for
`standardization`_. There are `no practical limits`_ to how much can safely
be encrypted under a given key (up to 2â�¶â�´ messages each containing up
to 2â�¶â�´ bytes).

.. _standardization: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha
.. _XChacha20-Poly1305: https://doc.libsodium.org/secret-key_cryptography/aead#xchacha-20-poly1305
.. _no practical limits: https://doc.libsodium.org/secret-key_cryptography/aead#limitations

:param key: The secret key used to encrypt and decrypt messages
:param encoder: The encoder class used to decode the given key

:cvar KEY_SIZE: The size that the key is required to be.
:cvar NONCE_SIZE: The size that the nonce is required to be.
:cvar MACBYTES: The size of the authentication MAC tag in bytes.
:cvar MESSAGEBYTES_MAX: The maximum size of a message which can be
                        safely encrypted with a single key/nonce
                        pair.
c                ó:   <€ V ^8„  d   QhRS[ RS[P                  /# r   r   )r   r   s   "€r   r   ÚAead.__annotate__È   s%   ø€ ÷ ñ áðñ ×!Ñ!ñr   c                ó  € VP                  V4      p\        V\        4      '       g   \        P                  ! R 4      h\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      hWn        R# )z"AEAD must be created from 32 bytesr   Nr   r%   s   &&&r   r'   ÚAead.__init__È   sc   € ð
 �n‰n˜SÓ!ˆÜ˜#œu×%Ò%Ü—-’-Ð DÓEÐEäˆs‹8�t—}‘}Ô$Ü—.’.Ø7¸$¿-¹-ÕGóð ð Ž	r   c                ó    <€ V ^8„  d   QhRS[ /# r*   r,   )r   r   s   "€r   r   rb   Ø   r-   r   c                ó   € V P                   # r/   r0   r1   s   &r   r2   ÚAead.__bytes__Ø   r4   r   r   Nc          
      ó\   <€ V ^8„  d   QhRS[ RS[ RS[S[ ,          RS[P                  RS[/# )r   r6   Úaadr7   r   r+   r8   )r   r   s   "€r   r   rb   Û   sG   ø€ ÷ 1
ñ 1
áð1
ñ ð1
ñ ™�ð	1
ñ
 ×!Ñ!ð1
ñ 
ñ1
r   c                ó¨  € Vf   \        V P                  4      p\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      h\
        P                  P                  WW0P                  4      pVP                  V4      pVP                  V4      p\        P                  ! VVVP                  W5,           4      4      # )a   
Encrypts the plaintext message using the given `nonce` (or generates
one randomly if omitted) and returns the ciphertext encoded with the
encoder.

.. warning:: It is vitally important for :param nonce: to be unique.
    By default, it is generated randomly; [:class:`Aead`] uses XChacha20
    for extended (192b) nonce size, so the risk of reusing random nonces
    is negligible.  It is *strongly recommended* to keep this behaviour,
    as nonce reuse will compromise the privacy of encrypted messages.
    Should implicit nonces be inadequate for your application, the
    second best option is using split counters; e.g. if sending messages
    encrypted under a shared key between 2 users, each user can use the
    number of messages it sent so far, prefixed or suffixed with a 1bit
    user id.  Note that the counter must **never** be rolled back (due
    to overflow, on-disk state being rolled back to an earlier backup,
    ...)

:param plaintext: [:class:`bytes`] The plaintext message to encrypt
:param nonce: [:class:`bytes`] The nonce to use in the encryption
:param encoder: The encoder to use to encode the ciphertext
:rtype: [:class:`nacl.utils.EncryptedMessage`]
r:   )r	   r;   r!   r   r#   r<   r=   Ú*crypto_aead_xchacha20poly1305_ietf_encryptr$   r?   r   r@   )r&   r6   ri   r7   r   rA   rB   rC   s   &&&&&   r   rD   ÚAead.encryptÛ   sª   € ð< Š=Ü˜4Ÿ?™?Ó+ˆEäˆu‹:˜Ÿ™Ô(Ü—.’.Ø9¸D¿O¹OÕKóð ô —]‘]×MÑMØ˜E§9¡9ó
ˆ
ð  Ÿ™ uÓ-ˆØ$Ÿ^™^¨JÓ7Ðä×+Ò+ØØØ�N‰N˜5Õ-Ó.ó
ð 	
r   c          
      ó\   <€ V ^8„  d   QhRS[ RS[ RS[S[ ,          RS[P                  RS[ /# )r   rA   ri   r7   r   r+   rG   )r   r   s   "€r   r   rb     sG   ø€ ÷ #ñ #áð#ñ ð#ñ ™�ð	#ñ
 ×!Ñ!ð#ñ 
ñ#r   c                ó@  € VP                  V4      pVf   VRV P                   pWP                  R p\        V4      V P                  8w  d(   \        P                  ! RV P                  ,          4      h\
        P                  P                  WW0P                  4      pV# rI   )	r   r;   r!   r   r#   r<   r=   Ú*crypto_aead_xchacha20poly1305_ietf_decryptr$   )r&   rA   ri   r7   r   r6   s   &&&&& r   rK   ÚAead.decrypt  s‹   € ð& —^‘^ JÓ/ˆ
àŠ=àÐ0 §¡Ð1ˆEØ#§O¡OÐ$5Ð6ˆJäˆu‹:˜Ÿ™Ô(Ü—.’.Ø9¸D¿O¹OÕKóð ô —M‘M×LÑLØ˜U§I¡Ió
ˆ	ð Ðr   r0   )rQ   rR   rS   rT   rU   r<   r=   Ú+crypto_aead_xchacha20poly1305_ietf_KEYBYTESr"   Ú,crypto_aead_xchacha20poly1305_ietf_NPUBBYTESr;   Ú)crypto_aead_xchacha20poly1305_ietf_ABYTESrN   Ú3crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAXrO   r   rZ   r'   r2   rD   rK   r\   r]   r^   s   @r   r`   r`   œ   s§   ø‡ € ñ"ðH �}‰}×HÑH€HØ—‘×KÑK€JØ�}‰}×FÑF€Hà�‰×IÑIð ð %-×$7Ñ$7÷ò ÷ ð ð Ø!%Ø$,×$7Ñ$7÷1
ò 1
ðl Ø!%Ø$,×$7Ñ$7÷#÷ #ð #r   r`   )Útypingr   r   Únacl.bindingsr<   r   r   r   Ú
nacl.utilsr   r   r	   Ú	Encodabler   r`   © r   r   Ú<module>rz      sF   ð÷ &ã Ý Ý "ß <Ñ <ôC�×"Ñ" Kô CôLUˆ8×Ñ˜{ö Ur   