title: AEAD AES-256-GCM in Node.js
body: <p>How to decrypt data encrypted by other languages with Node.js?
  To describe the problem, we write some code in Python:</p>
  <pre><code>plain_text = 'some data'
  nonce = 'some nonce string'
  associated_data = 'some associated data'
  key = '--- 32 bytes secret key here ---'
  </code></pre>
  <p>encrypting in python</p>
  <pre class="lang-py prettyprint-override"><code>from cryptography.hazmat.primitives.ciphers.aead import AESGCM
  import base64
  
  aesgcm = AESGCM(key.encode())
  encrypted = aesgcm.encrypt(nonce.encode(), plain_text.encode(), associated_data.encode())
  print(aesgcm.decrypt(nonce.encode(), encrypted, associated_data.encode()))
  
  ciphertext = base64.b64encode(encrypted)
  
  </code></pre>