MCPcopy
hub / github.com/authlib/authlib / decrypt

Method decrypt

authlib/jose/drafts/_jwe_enc_cryptography.py:39–51  ·  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

37 return ciphertext[:-16], ciphertext[-16:]
38
39 def decrypt(self, ciphertext, aad, iv, tag, key):
40 """Content Decryption with AEAD_CHACHA20_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 = ChaCha20Poly1305(key)
51 return chacha.decrypt(iv, ciphertext + tag, aad)

Callers

nothing calls this directly

Calls 1

check_ivMethod · 0.80

Tested by

no test coverage detected