MCPcopy Create free account
hub / github.com/authlib/authlib / decrypt

Method decrypt

authlib/jose/drafts/_jwe_enc_cryptodome.py:39–52  ·  view source on GitHub ↗

Content Decryption with AEAD_XCHACHA20_POLY1305. :param ciphertext: ciphertext in bytes :param aad: additional authenticated data in bytes :param iv: initialization vector in bytes :param tag: authentication tag in bytes :param key: encrypted key in bytes

(self, ciphertext, aad, iv, tag, key)

Source from the content-addressed store, hash-verified

37 return ciphertext, tag
38
39 def decrypt(self, ciphertext, aad, iv, tag, key):
40 """Content Decryption with AEAD_XCHACHA20_POLY1305.
41
42 :param ciphertext: ciphertext in bytes
43 :param aad: additional authenticated data in bytes
44 :param iv: initialization vector in bytes
45 :param tag: authentication tag in bytes
46 :param key: encrypted key in bytes
47 :return: message
48 """
49 self.check_iv(iv)
50 chacha = Cryptodome_ChaCha20_Poly1305.new(key=key, nonce=iv)
51 chacha.update(aad)
52 return chacha.decrypt_and_verify(ciphertext, tag)

Callers

nothing calls this directly

Calls 1

check_ivMethod · 0.80

Tested by

no test coverage detected