title: How to calculate IV on AuthenticateISO on DESFire EV1
body: <p>I'm having troubles creating new IV after authenticating. I'm not sure if my understanding of the concept is right, even with MIFARE documentation. Data on the card is fully enciphered.</p>
  
  <p>These are the steps I'm taking:</p>
  
  <ul>
  <li>AuthenticateISO with zero IV (0x1A with 3K3DES key)</li>
  <li>Response from card (encrypted RandA'):
  <code>08 48 CD A3 43 C5 00 FE 1D 78 D1 E5 A9 24 26 5A 91 00</code></li>
  <li>First 8 bytes should be CMAC and updated IV(?): <code>08 48 CD A3 43 C5 00 FE</code></li>
  <li>Create 3K3DES session key: <code>74 EF 23 87 10 E4 3B E6 BE C8 4C 41 74 03 08 A9 7F F3 FA 59 15 E4 C5 06</code></li>
  <li>Call getValue:<code>90 6C 00 00 01 [FileID] 00</code></li>
  <li>Response from card: <code>A2 3C CB 70 BE 4D D5 22 91 00</code></li>
  <li>Decrypt first 8 bytes from response with session key and updated IV</li>
  <li>Decrypted result: <code>7F 7D 80 F5 [CRC32]</code></li>
  </ul>
  
  <p>After the last step, the first four bytes should be the value and the last four CRC32. But for sure I'm not doing something right with IV, because result isn't correct. It should be <code>0F A0 00 00 [CRC32]</code>. </p>
  
  <p>Could anyone have any pointers to what I'm doing wrong? I've been trying to solve this for at least 2 weeks and have come nowhere.</p>