title: Decrypting a JWE token using JOSE with A256GCM
body: <p>I'm curious about this and wanted to see if anyone understands it.</p>
  
  <p>I am encoding a payload using the <code>jose-jwt</code> nuget in .NET:</p>
  
  <pre><code>Jose.JWT.Encode(
      payload, 
      keyBytes, 
      JweAlgorithm.A256GCMKW, 
      JweEncryption.A256GCM, 
      extraHeaders: extraHeaders)
  </code></pre>
  
  <p>and this returns a token that looks correct.</p>
  
  <p>When I use JOSE to decrypt the same payload:</p>
  
  <pre><code>Jose.JWT.Decode(payload, keyBytes, JweAlgorithm.A256GCMKW, JweEncryption.A256GCM);
  </code></pre>
  
  <p>It throws an error:</p>
  
  <blockquote>
    <p>BCrypt.BCryptDecrypt(): authentication tag mismatch</p>
  </blockquote>
  
  <p>Is this normal? Is the JWE encryption supposed to be unable to be decrypted or can someone explain why this error is happening?</p>
  
  <p>Thanks</p>