nl_tokens: Decrypt text using AES - GCM
pl_tokens: function decryptGCM ( encryptedComponents , keyDerivationInfo ) { // Extract the components const encryptedContent = encryptedComponents . content ; const iv = <mask> Buffer ( encryptedComponents . iv , "hex" ) ; const { auth : tagHex , salt } = encryptedComponents ; // Prepare tool const decryptTool = crypto . createDecipheriv ( ENC_ALGORITHM_GCM , keyDerivationInfo . key , iv ) ; // Add additional auth data decryptTool . setAAD ( new Buffer ( ` ${ encryptedComponents . iv } ${ keyDerivationInfo . salt } ` , "utf8" ) ) ; // Set auth tag decryptTool . setAuthTag ( new Buffer ( tagHex , "hex" ) ) ; // Perform decryption const decryptedText = decryptTool . update ( encryptedContent , "base64" , "utf8" ) ; return Promise . resolve ( ` ${ decryptedText } ${ decryptTool . final ( "utf8" ) } ` ) ; }