31 August 2010

C-MAC java card GlobalPlatform Secure Channel

 How to make C-MAC
 the weirdest part of secure channel / authentication with a Card

 written with  javax.smartcardio and  ERACOM provider


    byte[] makeC_MAC(byte[] toauth, byte[] Sess_C_MAC, byte[] iv) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException {

 //       toauth = command less 8 bytes of MAc DATA AND WITHout Le
//       make the C_MAC   "Retail MAC"
//       plain = apdu  without the C_MAC tail...  pad it
//       key = Sess_C_MAC
//       Lc is set to +8 to allow for cmac

//    iv is the previous C_MAC
//    encrypt  1ST8 bytes of the 16bytes (padded) message using 1ST 8 bytes of the
//    C-MAC session key:
            toauth = padm16(toauth);  // pad the chopped message ie missing the 8 bytes where C-MAC will go
            byte[] plaina = new byte[8];
            byte[] bkeya  = new byte[8];
            System.arraycopy(toauth, 0, plaina, 0, 8);
            System.arraycopy(Sess_C_MAC, 0, bkeya, 0, 8);   // Sess_C_MAC I prepared earlier
            //   E(f8(Sess_C__MAC)) [f8 message]
            Cipher desCipher = Cipher.getInstance("DES/ECB/NoPadding", "ERACOM");  // eracom the classic from QUT
            SecretKey kca = makey8(bkeya);   // key factory stuff turns bytes into a key
            IvParameterSpec ivp = new IvParameterSpec(iv);  //  bytes into ivp
            desCipher.init(Cipher.ENCRYPT_MODE, kca,ivp);   //Care iv is chained....... from the previous C-MAC
            byte[] ciphert = desCipher.doFinal(plaina); 
            //xor the first 8bytes that were encrypted with the last 8bytes of "plain text"
            for (short i = 0; i < 8; i++) {
                ciphert[i] ^= toauth[i + 8];   // better: this could be done via ERACOM cbc??
            }        //       encrypt this 8bytes using the final TripleDES:
            Cipher enc = Cipher.getInstance("DESede/ECB/NoPadding", "ERACOM");
            SecretKey key3 = makey(Sess_C_MAC); // 16 bytes to 24  then keyfactory stuff
            //ERACOM  insists on a 24byte key so copy the first 8
            enc.init(Cipher.ENCRYPT_MODE, key3);  // do we use ivp? ecb ... would seem not
            C_MAC = enc.doFinal(ciphert);   //C_MAC
            //print("\n makeCMAC C_MAC " + Hex2String(C_MAC));
            return C_MAC;
    } // makec_mac______________________________










nb: Currently, I can establish a secure channel, but I currently can't carry on the chain of C-MACS,
so something is wrong.


I'm confused about the iv chaining from previous C-MAC, since both DES are ECB, so where does the iv go?  The first time its zeros, so it doesnt matter?

I'm pleased I can authenticate, since you only get 10 failed attempts, then the card is Terminated with extreme prejudice   - I've terminated 3 or 4.

R-MAC

Response Authentication R-MAC
We want the Card to add a MAC ie Sign a response

GPCardSpec_v2.2.pdf the standards say


"At any time, the BEGIN R-MAC SESSION command may be issued to the card in order to initiate a R-MAC session. "
which looks good. We dont want to use GP secure channel for every-day use.


So I wrote some Java:

ReadOurFile xxxxxdataComesback9000 our propriatery read data command
init R_MAC 6E00 ...... SW_CLA_NOT_SUPPORTED",
ReadOurFile xxxxxdataComesback9000    no R-MAC added
______________________________________________________


But Sun Forums say it isnt so:  old MAC is not back in town
____________________________________________________
From a Sun forum in 2007
http://forums.sun.com/thread.jspa?forumID=23&threadID=764277

I guess it is done with the BEGIN R-MAC SESSION command.

From GlobalPlatform 2.1.1 BEGIN R-MAC SESSION command specification:
P1 = 0x30 => Response Encryption and R-MAC (RFU)

Unfortunately this command is optional in GlobalPlatform and seems not to be supported by the JCOP cards.
.....
. Reasoning: JCOP does not support R-MAC.

beware of commenting on an old thread, SunForums have people who look for that and call you a zombie
- sure the original guy wont answer, but google brought me here, so it may bring others
_____________________________________________________
from 2009
http://forums.sun.com/thread.jspa?forumID=23&threadID=700765
http://forums.sun.com/thread.jspa?forumID=23&threadID=5375447
In addition, let me say that a lot of cards only implement VGP (visa GP) which is a subset of the real GP, but without support for the on card wrapping and DENC encryption. On these cards (when the SD aid is visa, ie A000000003 000000) only org.globalplatform.SecureChannel.unwrap() and org.globalplatform.SecureChannel.decryptData() is allowed. Absence of support for SecureChannel.wrap() means no support for R-MAC.
_____________________________________________________
GPShell response:

enable_trace
establish_context
card_connect -readerNumber 3
* reader name OMNIKEY CardMan 5x21-CL 0
select -AID a0000000030000
Command --> 00A4040007A0000000030000
Wrapped command --> 00A4040007A0000000030000
Response <-- 6F65...... etc etc send_apdu -sc 0 -APDU 847A1001 Command --> 847A1001
Wrapped command --> 847A1001
Response <-- 6985
send_APDU() returns 0x80206985 (6985: Command not allowed - Conditions of use not satisfied.)


Looks like no card R-MAC, you gotta write it yourself for your CAP

30 August 2010

Yoban’tel

"Yoban’tel"


June 28, 2010  Societe Generale and Obopay..teaming to bring mobile payment services to banked and unbanked customers who have a mobile phone. ..today in Senegal .. Societe Generale de Banques au Senegal (SGBS).

"Yoban’tel" ... carrier-agnostic, mobile money transfer and bill payment  .. all of Senegal with a mobile phone.
...enroll for a mobile payment service and load or pick up cash at designated locations throughout Senegal. ..send money to anyone throughout the country, or to pay a bill.

..
Yoban’tel by Obopay, any Senegalese.. a mobile phone.. send money to recipients using a simple SMS transaction. ..
    * ..existing customers of the bank or new customers through a prepaid account (unbanked??)
    * Any mobile phone  ... a simple SMS message to send the transfer request, without having to change the phone’s SIM card or install an application on the phone
    * ...compatible with all  carriers;  ..carrier-agnostic and not limited to transfers within a single network
..Carol Realini, ..founded the company following volunteer work in Africa, ... US, India, Kenya and now Senegal..

Founded in 2005  banks.obopay.com  .. interoperable mobile payments service by transforming any mobile phone.. easy way to send and receive money.  ... Mobile Money for Banks offers bank-branded
obopay
WesternUnion's grotesque profits  may be doomed
____________________________________________________________
Some Banks in Mexico have raised the limit on Pre-Paid cards ($10,000?)
 ...  transfers from USA are now simplified...
___________________________________________________________
 select schools around Metro Manila, Smart Tag  Internet access for P15 per 30 minutes "much cheaper than the P100 per hour offers of other WiFi ".   ... five-day, unlimited WiFi access for only P150.

..700 hotspots .. Starbucks, Jollibee and Chowking.

..reloadable..valid for one year ... 11,000 students and staff of Smart Tag pilot schools have been given free pre-loaded Smart Tag cards worth P150, which they may consume for five days, 24/7. (expiration...)


“In Ateneo, the campus is too big for all of us to share the wireless broadband connection the school provides. We would rather go outside the campus ..

Julius Sareno, IT director of TUP Manila, said the product serves students well since it encourages students to stay within the campus (???)
technology.inquirer
____________________________________________________________
With myki more than three years late and at least $352 million over budget, the authority continues to spend taxpayer dollars on more expensive taxi trips despite the $1.35 billion "smartcard" system's shortcomings, Freedom of Information documents reveal.
Melbourne..

25 August 2010

Key Derivation ... CPG 2.04

Key Derivation ...  CPG 2.04  found?

Caution: nowhere in the EMV docs is 'CPG' or 'CDK' mentioned,
remains to be seen how useful this is:
(we are not EMV?)

From
emvco

CPS1.x

EMV_CPS_v1.1_20070720_20090125100741.pdf
....2.1.1 Issuer Master Keys and Data

EMV personalization ..the card issuer creates master keys

..  The master keys are used in two ways, firstly to support secure transmission of personalization data and secondly to create application-level data for personalization of an EMV application.

... a method of importing or exporting master keys to allow appropriate data sharing between processes will be required.
Prior to the personalization process the identifier of the personalization master key KMCID, key version number, KEYDATA and the corresponding relevant keys, must be placed onto the card. KMCID and key version number are used to access (???)  the issuer personalization master key (KMC) in order to derive the card unique static keys using diversification data (KEYDATA).

The 6 byte KMCID (e.g. IIN right justified and left padded with 1111b per quartet)(?????)

concatenated with the 4 byte CSN (least significant bytes) form the key diversification data that must be placed in tag ‘CF’. This same data must be used toform the response to the INITIALIZE UPDATE command.
....................

Table 1 Data Content for tag ‘CF’

Data Element  Description  ...........Length  Format

KEYDATA ......Key derivation data:    10      binary

..............- KMCID (6 bytes)

..............- CSN (4 bytes)


 Table 13 INITIALIZE UPDATE Command Coding

 "8050 xx:00 08=cccccccccccccccc 00"

 cc.. = host challenge

 xx = 00..7f  see 3.2.5.3  Key Version Number  (use 00)


Table 14  Response to INITIALIZE UPDATE command

Field  Length

KEYDATA (See Table 15) ........................10

Version number of the master key (KMC) ..........1

Identifier for Secure Channel Protocol (ALGSCP = ‘02’) .......1

Sequence Counter ................2

Card challenge (R_CARD) .........6

Card cryptogram .................8

SW1 SW2 .........................2


Table 15  Initial Contents of KEYDATA

Field  Length  Format

Identifier of the KMC (e.g. IIN right     ..........6 BCD
justified and left padded with 1111b per quartet) (???)  what is a quartet??? some kind of Eurotrash choir??

Chip Serial Number (CSN) .................4 Binary

............................

 The first 6 bytes of KEYDATA returned from the INITIALIZE UPDATE command are used to identify (???) the master key for secure messaging (KMC).
The six least significant (??? they dont mean it) bytes of KEYDATA are used as key diversification data.  The personalization device must use the KMC and KEYDATA to generate the KENC, the KMAC and the KDEK for this IC card,is defined in section 4.1.  These keys must have been placed in the IC card

prior to the start of the personalization process.

.........................................

4.1 ..Pre-Personalization


Prior to personalization the ICC must be enabled/activated, the basic EMV

application loaded, and the file and data structure established. .....

..

4.1.1.2  Each application must be selectable by its AID.

4.1.1.3  If the File Control Information (FCI) for the application is not to be personalized, it must be created prior to personalization.

4.1.1.4  KEYDATA must be set as shown in Table 15.  KEYDATA is composed of KMCID and Chip Serial Number (CSN). KMCID is the identifier (???) of the master personalization key to be supplied by the card issuer or the personalizer.  The length of KMCID is 6 bytes. The CSN is rightmost 4

bytes(!!!  is rightmost most or least significant?? ) of the physical identifier of the card.

4.1.1.5  The version number of the personalization master key (KMC) used to generate the initial personalization keys (the KENC, the KMAC and the KDEK) for each application must be on the IC card.

4.1.1.6  A derived key (KENC) must be generated for each IC card and placed into the application.  This key is used to generate the card cryptogram and to verify the host cryptogram. This key is also used to decrypt the STORE DATA command data field in CBC mode if the security level of secure
messaging requires the command data field to be encrypted.


The KENC is a 16 byte (112 bits plus parity) DES key.

The KENC will be derived in the following way: KENC := DES3(KMC)[Six least  significant bytes of the KEYDATA || ’F0’ || ‘01’ ]|| DES3(KMC)[ Six least  significant bytes of the KEYDATA || ‘0F’ || ‘01’].

4.1.1.7  A derived key (KMAC) must be generated for each IC card and placed into the card.  This key is used to verify the C-MAC for the EXTERNAL AUTHENTICATE command and also to verify the C-MAC for the STORE DATA command(s) if the security level of secure messaging requires a MAC of the command data. 


The KMAC is a 16 byte (112 bits plus parity) DES key


The KMAC will be derived in the following way: KMAC := DES3(KMC)[ Six least significant bytes of the KEYDATA  || ’F0’ || ‘02’ ]|| DES3(KMC)[ Six least significant bytes of the KEYDATA || ‘0F’ || ‘02’].


4.1.1.8  A derived key (KDEK) must be generated for each IC card and placed into the card.  This key is used to decrypt in ECB mode secret data received in the STORE DATA command. 

The KDEK is a 16 byte (112 bits plus parity) DES key. 

The KDEK will be derived in the following way: KDEK := DES3(KMC)[ Six least significant bytes of the KEYDATA || ’F0’ || ‘03’ ]|| DES3(KMC)[ Six least significant bytes of the KEYDATA || ‘0F’ || ‘03’].


4.1.1.9  For each Secure Channel key set the sequence counter to be returned in the response to the INITIALIZE UPDATE command must be initialized to’0000’.

________________________________________

So we can 'identify'   the master key KMC'

we have  'the identifier (???) of the master personalization key'

but what the hell IS the KMC???

I suppose expensive English Publlic school or Ecole Normal education is a pre-requisite to write bad specifications  like the above......

The field of cryptography is stuffed with types of people who are incapable of clear thought or description, They get away with it because they appear to be guarding secrets.

A culture of 'Security through Oscurity impedes the progress of useful industries, and has a negative impact on security.

___________________________________

From:

pre-zombie sun forum thread:

forums.sun.com5

...

"The tool is "Jload2 advanced", I just choose a so-called key file named "GD_V_CDK (CPG 2.04).key", is defines a Master key (40:41:..:4F), the key set (0) and the key derivation method namely CDK04.

I could not find any information regarding CPG 2.04, neither for key derivation method CDK04.

spec name is EMV CPS 1.x). As Dan said, the static keys KMAC,KENC and KDEC are derived and there's a section in this spec that describes the derivation.

...Whoaaa... Yes, it does work, the answer lies in Section 4.1 of the CPS 1.1 document

__________________________________

Java Card News

items from APSCA Smart Cards Business Intelligence
- I probably wont continue to select these ... get your own email sub.

ps new blogger editor sucks.. links my editor did w macros are now broken..  dont upgrade from classic



>aaa
________________________________________________________________________
"This badass looking weapon won't hurt a fly - but it will kill any RFID tag you point it at. The Rfiddler gun can be aimed at unsuspecting RFID tags and destroy their data by simply overloading the tags with a very strong electromagnetic field." 
technabob
________________________________________
New Oyster cards will use MiFare DesFire chips by NXP semiconductors. The previous chipset, MiFare Classic, is in the process of being phased out. The MiFare Classic chipset has suffered a number of cryptographic cracks by security researchers. [2007 keys were 48 bits only, attackers shaved the chips?]

"TfL began the phased replacement of MiFare [Classic] Oyster cards last year and London Underground ticket offices continue to gradually swap existing cards.. 
zdnet
.zdnet court-rules-university-can-publish-oyster-crack
________________________________________
Will you be able to swipe your iPhone 5 like an Oyster card?
Apple has hired a chap called Benjamin Vigier who works in near-field communication (NFC),.. wireless data from chips within devices such as the Tube's Oyster cards to payment terminals ..

Apple has already built NFC-enabled prototype iPhones.. Nokia has already trialled NFC in the UK with the Nokia 6215.
__________________________________________
Octopus was way off track, says sorry MTRC boss
Tony Liaw  Friday, August 13, 2010
MTR Corp has apologized again for the privacy scandal involving Octopus Cards, which made HK$44 million from the sale of private data.
MTRC chief executive Chow Chung-kong vowed the smart card operator will never again sell any personal information.....the CEO resigned .. who would have thought Communist Hong Kong would be so sensitive about privacy?
.thestandard.com.hk
_____________________________________________
: ATMs with touch-points.:
KUALA LUMPUR, August 19 (Bernama) -- CIMB Bank, the commercial banking arm of CIMB Group, announced the waiver of Touch 'n Go reload charge at its automated teller machines (ATMs) nationwide effective Friday. expand »

The service is available 24 hours, seven days a week and at all the bank's ATMs with Touch 'n Go touch-points.

bernama

22 August 2010

Retail MAC aka C_MAC

 tamed the C_MAC
Authenticated  Host <-> Card
Secure Session established

(only 1 card Terminated due to 10 bad tries)

This is the output:


 PC/SC terminal OMNIKEY CardMan 5x21-CL 0... wait 5  PC/SC card in OMNIKEY CardMan 5x21-CL 0, protocol T=1, state OK assigned to Card
 UID  CBE7DED8
 Card Manager  6F658...
 -> init_update 80500000085B74845D1FFCCE89
 <- card response  00009235001489950936FF020023470BDAF18E9C76C016B156A0D544
 Key_info    FF02
 Card_seq  0023
 Card_challenge  470BDAF18E9C
 Card_cryptogram  76C016B156A0D544
Sess_enc  5B49746D3E3E88290E51AC62AC2E46A3
Sess_C_MAC  473B7DCDE0E3E8EC24DFDC900D3BE93B
Sess_DEK    2BEF4B5837C13BE7B69CF5EF584D9CB5
 Card Cryptogram matched true at 32
 Host cryptogram before ENC 0023470BDAF18E9C5B74845D1FFCCE898000000000000000
 C_MAC 3126F78398CCB68D
-> external_authenticate 84820300106531817D2E170FAD3126F78398CCB68D
 Secure Session Established 


Using  javax.smartcardio    with ERACOM/Cryptoki




Eracom emerged from QUT (Queensland University of Technology), late 80's
Prof Bill Caelli and Prof Jennifer Seberry (Wollongong) ran a couple of good AusCrypts 88 & 92
I Spoke denigrating Montgomery Multiplication, which obviously kicks in somewhere past a few thousand bits.

19 August 2010

HelloCard How to Read Java Cards

/**
 *  HelloCard
 * @author ctskinner
 * JavaCard read  ......   not tear-proof.... you can tearaway and halt the program   ..if you're fast
 *
 *  version of  zigosoft    forums.sun
 *
 */

package here.there.and.everywhere;
import java.awt.Toolkit;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;

import javax.smartcardio.ATR;
import javax.smartcardio.Card;
import javax.smartcardio.CardChannel;
import javax.smartcardio.CardException;
import javax.smartcardio.CardTerminal;
import javax.smartcardio.CardTerminals;
import javax.smartcardio.CommandAPDU;
import javax.smartcardio.ResponseAPDU;
import javax.smartcardio.TerminalFactory;

public class HelloCard {
    private static final String sSelect    =
            "00A4 04 00  0b 0102030405060708090000  00";
    // Java byte arrays are so ugly... use Strings ...
    private static final String sread_uid  =
            "FFCA 00 00 00";
    private CommandAPDU SELECT_APDU = new CommandAPDU(String2Hex(sSelect));
    private CommandAPDU UID_APDU    = new CommandAPDU(String2Hex(sread_uid));

    private CardTerminal terminal = null;
    private Card card = null;
    private String terminalName;
    private String terminalType;
    private String terminalProtocol;

  
    public static void main(String[] args) {
        try {
            HelloCard hcApp = new HelloCard();
            hcApp.go();
        } catch(Exception e) {
            print(" Error: " + e.getMessage());
        }
    }

    private HelloCard() throws Exception {
        terminalProtocol = "T=0";
        init();
    }

    private static void print (String s) {
        System.out.print(s);
    }
    private void init() throws Exception {
        System.setProperty("sun.security.smartcardio.t0GetResponse", "false");  // ensures 61xx   if T=0 you must handle data returns yourself
        TerminalFactory tf = TerminalFactory.getDefault();
        CardTerminals ct = tf.terminals();
        List<CardTerminal> l = null;
        Card card = null;

        try {
            l = ct.list();
        } catch (Exception e) {
            print (" Error listing Terminals: " + e.toString());
            throw e;
        }

        print (" List of PC/SC Readers connected:\n");
        ListIterator i = l.listIterator();
        while (i.hasNext()) {
            String tn = ((CardTerminal) i.next()).getName();
            print("Reader: " + tn + "\n");
//          pick the first NFRadio contactless
            if (    (tn.contains("-CL"))    && (terminal == null)    )
                terminal = ct.getTerminal(tn);
        }
//      terminalName = l.get(1).getName();
        print ("Terminal fetched: " + terminal.getName() + "\n");
    }

    byte[] UIDstore = {0x00,0x00,0x00,0x00};
    byte[] UID = {0x00,0x00,0x00,0x01};
    public void go() {
        try {
            while (terminal.waitForCardPresent(0)) {

                try {
                    card = terminal.connect("*");
//                    card = terminal.connect(terminalProtocol);
                    print("\nCard on protocol "   + card.getProtocol());
                } catch (Exception e) {
                    print("\nTerminal NOT connected: " + e.toString());
                }
                CardChannel ch = card.getBasicChannel();
                ResponseAPDU ra = ch.transmit(UID_APDU);
                // some cards randomise UID between sessions
                if (check9000(         ra       )) {
                    print("    UID " + Hex2String(ra.getData()));
                    System.arraycopy(ra.getData(),0,UID,0,4);
      
                } else {
                    print("UID NOT OKAY");
                    return;
                }
                if (! (Arrays.equals(UID,UIDstore)) ) {
                     print("    New Card   ATR ");
                    ATR atr = card.getATR();   // dont do this too often!
                    System.arraycopy(UID,0,UIDstore,0,4);
                    print(  Hex2String(  atr.getBytes()  )   );
                }

                // Put here code for sending/receiving APDUs
                // DO SOMETHING WITH Card HERE
               
                //             Toolkit.getDefaultToolkit().beep();  // nogo
                terminal.waitForCardAbsent(0);
                print ("    Card removed    ");
            }// while
        }// try
        catch (CardException e) {
            System.out.println("Error isCardPresent()" + e.toString());
        }
    }
    public static boolean check9000(ResponseAPDU ra) {
        byte[] response = ra.getBytes();
        return (response[response.length - 2] == (byte) 0x90 && response[response.length - 1] == (byte) 0x00);
    }


    public static String  Hex2String(byte[] b) {
        String result="";
        for (byte by:b)
            result+= String.format("%02X", by);
        return result;
}
    public static String stripGarbage(String s) {
    String good =
      "ABCDEF0123456789";
    String result = "";
    for ( int i = 0; i < s.length(); i++ ) {
        if ( good.indexOf(s.charAt(i)) >= 0 )
           result += s.charAt(i);  //stringbuilder might be better
        }
    return result;
    }//______________________________________________

    public static byte[] String2Hex(String sin){
        sin = sin.toUpperCase(); 
        sin = stripGarbage(sin);
        byte[] bout = new byte[sin.length() / 2];  // sz must be even...
        if ((sin.length() & 1) != 0)
            return bout;
        try {
            for (int j = 0; j < sin.length()-1; j+=2) {
                bout[j/2] = (byte)(Integer.parseInt(sin.substring(j,j+2),16));
            } // for
        } // try
        catch (Exception ex) {
            print(" String2Hex " + ex.getMessage() );
        }

        return bout;
    }//_______________________

 
}  //Class____________________________________________________

18 August 2010

First Post

"God made the integers; all else is the work of man" Leonard Kronecker

This B log will be about Java Card  and Information Security

because Marisa Fagan dewzi says you gotta have a blog & a twitter
right now twitter is overloaded and cant/isnt send/ing my conformation 

referred to by lavamunky
____________________________________________________________________
About Me:
I wrote an 80386 Assembler Modular Division (from Knuth, naturally) pre 1990 which may have been the fastest PC RSA in the world for a few months.  
____________________________________________________________________
Here are some Java Card links :
jcManager
frombrokenmill
Loads and registers a CAP!
__________________________________________________________
Jaccal:


 jaccal

 comes with anubis.exe: program send commands to card..     saush shows how to use it to read your bank account number from EMV card (VISA card with a chip)
__________________________________________________________
BER/ASN decoder: asn1ve.exe
the free version is a neat decoder.    asn1ve

Card data is sometimes BER encoded, hint: cut and paste into asn1ve to see if it decodes.
The Java TLV class is typically abstruse...
...
My comment on this coment posted in    0x9000
"CPLC data is Visa proprietary. At the beginning (OP 2.0.1) they used to maintain a list for all the tags, but not anymore. " sun
[Still not published it seems]
Note CPLC is not actually "tagged" it is arranged in blocks of 4 or 8 bytes

__________________________________________

Java Card tools cont... #2  (why cant I paste WinWords silly "hyperlinks" here???)

          emvlab                 ...<<< Recommended
decodes tlv, does DESede, does kcv, derives session keys from the card master key,
as specd in  in EMV 4.1, Book 2, Part III, Annex A1.3.
__________________________________________
[EMV seem to have moved on to 4.2  
emvco   emvco.com
__________________________________________
ttfn   http://www.ttfn.net/techno/smartcards/iso7816_4.html
is a neat layout of iso7816
__________________________________________
free-books-online   http://free-books-online.net/emv-iso-7816-6-tlv-pdf-7
a good search engine for docs
__________________________________________
 seen: Several Python 'hello world' caps - ...
__________________________________________
Omnikey diagnostic tool:
get ATR and UID
hidglobal      hidglobal.com/driver                    << 1st step in examining a card
__________________________________________
All you want to know about ATR  .. and more
(you dont need to know anything about ATR except: it often has some descriptive text "historical data"
eg
   ATR 3B 8A 80 01 4A 43 4F 50 33 31 56 32 33 32 7A  
   ....                              J   C  O   P   3    1   V   2    3   2    z
satxpress     http://www.sat.su/satxpress/SmartCard/ISO7816-3.htm
also describes T=0 and T=1 differences, oddly enough, would have been usefull to know
__________________________________________

Accecss Java Card from a web page     .springcard.com
05/07/2010, 05:23 by johann.d