title: Authentication keys in smart cards
body: <p>I use <strong>JCManager</strong> tool load applets on my java-cards. This software has three fields for authentication keys in the top named <code>S_ENC</code>, <code>S_MAC</code> and <code>DEK</code>.</p>
  
  <p>As I know, <code>ENC</code> stands for <em>Encryption</em>, <code>MAC</code> stands for <em>Message Authentication Code</em> and <code>DEK</code> stands for <em>Data Encryption Key</em>.</p>
  
  <p>I want to know when they used (which step in communication? <em>INITIAL UPDATE</em> , <em>EXTERNAL AUTHENTICATION</em>? ... )?</p>
  
  <p>Does all of these three keys, used in every communications or some of them are optional to use?</p>
  
  <p>and where? (Card or Terminal or both?)</p>
  
  <p>And also, I want to know  what is <code>KEK</code>? Is there any <code>KEK</code> in smart cards?</p>