title: Desfire EV1 communication examples
body: <p>There are lots of questions about Desfire EV1 cards here on Stackoverflow.
  But if you search for some example data the only place where you will find a few bytes is in <a href="https://ridrix.wordpress.com/2009/09/19/mifare-desfire-communication-example/" rel="noreferrer">Ridrix Blog</a>. But this is quite incomplete. </p>
  
  <p>A lot of people wrote their problems there while developing code for Desfire cards. But mostly when they solved their problem they were too lazy to post the solution. So you find many questions but very few answers with data examples.</p>
  
  <p>Even if you have the Desfire EV1 documentation (I dont have it, I studied <a href="https://github.com/nceruchalu/easypay" rel="noreferrer">easypay</a> code), you will need more than that. A documentation is only theory. But what is the reason that your card returns an Authentication Error or an Integrity Error or an unexpected CMAC?</p>
  
  <ul>
  <li>Is the Session key OK ?</li>
  <li>Is CBC working in the correct mode ?</li>
  <li>Is the CMAC calculated correctly ?</li>
  <li>Is the CRC32 correct ?</li>
  <li>Is the IV of the session key correct before / after a function call ?</li>
  </ul>
  
  <p>Without examples you are completely lost.</p>