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

Method encrypt

authlib/jose/rfc7516/models.py:76–85  ·  view source on GitHub ↗

Encrypt the given "msg" text. :param msg: text to be encrypt in bytes :param aad: additional authenticated data in bytes :param iv: initialization vector in bytes :param key: encrypted key in bytes :return: (ciphertext, tag)

(self, msg, aad, iv, key)

Source from the content-addressed store, hash-verified

74 raise ValueError('Invalid "iv" size')
75
76 def encrypt(self, msg, aad, iv, key):
77 """Encrypt the given "msg" text.
78
79 :param msg: text to be encrypt in bytes
80 :param aad: additional authenticated data in bytes
81 :param iv: initialization vector in bytes
82 :param key: encrypted key in bytes
83 :return: (ciphertext, tag)
84 """
85 raise NotImplementedError
86
87 def decrypt(self, ciphertext, aad, iv, tag, key):
88 """Decrypt the given cipher text.

Calls

no outgoing calls