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

Method decrypt

authlib/jose/drafts/_jwe_enc_cryptography.py:38–50  ·  view source on GitHub ↗

Content Decryption with AEAD_CHACHA20_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

36 return ciphertext[:-16], ciphertext[-16:]
37
38 def decrypt(self, ciphertext, aad, iv, tag, key):
39 """Content Decryption with AEAD_CHACHA20_POLY1305.
40
41 :param ciphertext: ciphertext in bytes
42 :param aad: additional authenticated data in bytes
43 :param iv: initialization vector in bytes
44 :param tag: authentication tag in bytes
45 :param key: encrypted key in bytes
46 :return: message
47 """
48 self.check_iv(iv)
49 chacha = ChaCha20Poly1305(key)
50 return chacha.decrypt(iv, ciphertext + tag, aad)

Callers

nothing calls this directly

Calls 1

check_ivMethod · 0.80

Tested by

no test coverage detected