title: Cannot authenticate NTAG213
body: <p>I am using an ACR122U NFC reader to password protect an NTAG213 NFC label. I think I have managed to set the password correctly, but I cannot authenticate and change the label afterward. My code for authenticating looks like this:</p>
  
  <pre><code>#include &lt;winscard.h&gt;
  #include &lt;iostream&gt;
  #pragma comment(lib, "winscard.lib")
  
  const char *ReaderName = "ACS ACR122 0";
  unsigned Password = 0x12345678;
  
  int main()
  {
    //Establish context
    SCARDCONTEXT              hContext;
    DWORD SCard_Status1 = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &amp;hContext);
    if(SCard_Status1 != SCARD_S_SUCCESS)
      return 1;
  
    //connect to the card
    SCARDHANDLE   hCardHandle;
    DWORD Protocol;
    DWORD SCard_Status2 = SCardConnect(hContext, ReaderName, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T1, &amp;hCardHandle, &amp;Protocol);
    if(SCard_Status2 != SCARD_S_SUCCESS)
    {
      SCardReleaseContext(hContext);
      return 1;
    }
  
    SCARD_IO_REQUEST Request;
    Request.dwProtocol = Protocol;
    Request.cbPciLength = sizeof(SCARD_IO_REQUEST);
    BYTE TxData[] =
    {
      0xFF, //CLA
      0x00, //INS
      0x00, //P1
      0x00, //P2
      0x08, //LC
      0xD4,
      0x40,
      0x01,
      0x1B, //PWD_AUTH (See data sheet)
      Password,
      Password &gt;&gt; 8,
      Password &gt;&gt; 16,
      Password &gt;&gt; 24,
    };
  
    BYTE RxData[254];
    unsigned long RxLength = sizeof(RxData);
    DWORD SCard_Status3 = SCardTransmit(hCardHandle, &amp;Request, TxData, sizeof(TxData), NULL, RxData, &amp;RxLength);
    std::cout &lt;&lt; "SCard_Status = " &lt;&lt; SCard_Status3 &lt;&lt; std::endl;
    std::cout &lt;&lt; "RxLength = " &lt;&lt; RxLength &lt;&lt; std::endl;
  
    SCardDisconnect(hCardHandle, SCARD_EJECT_CARD);
    SCardReleaseContext(hContext);
    return 0;
  }
  </code></pre>
  
  <p>This should send the PWD_AUTH command to the NTAG213 with the Pwd. I expected to receive an error if the password is wrong or two bytes with the PACK if the password is correct. But SCard_Status is SCARD_S_SUCCESS and RxLength is 0 afterwards. And if I try to write to the label I get an error. </p>
  
  <p>I am having trouble finding any examples showing how to do this. Can anyone see what I am doing wrong?</p>