parameters: (self, text)
return_statement: return plain_text_bytes.decode('utf-8')
docstring: 提取header, nonce, tag并解密text。
docstring_summary: 提取header, nonce, tag并解密text。
docstring_tokens: 提取header nonce tag并解密text。
function: def decrypt(self, text):
          """
          提取header, nonce, tag并解密text。
          """
          metadata = text[:72]
          header = base64.b64decode(metadata[:24])
          nonce = base64.b64decode(metadata[24:48])
          tag = base64.b64decode(metadata[48:])
          ciphertext = base64.b64decode(text[72:])
  
          cipher = AES.new(self.key, AES.MODE_GCM, nonce=nonce)
  
          cipher.update(header)
          plain_text_bytes = cipher.decrypt_and_verify(ciphertext, tag)
          return plain_text_bytes.decode('utf-8')
function_tokens: def decrypt ( self , text ) : metadata = text [ : 72 ] header = base64 . b64decode ( metadata [ : 24 ] ) nonce = base64 . b64decode ( metadata [ 24 : 48 ] ) tag = base64 . b64decode ( metadata [ 48 : ] ) ciphertext = base64 . b64decode ( text [ 72 : ] ) cipher = AES . new ( self . key , AES . MODE_GCM , nonce = nonce ) cipher . update ( header ) plain_text_bytes = cipher . decrypt_and_verify ( ciphertext , tag ) return plain_text_bytes . decode ( 'utf-8' )