1 2 Previous Next 28 Replies Latest reply: Jun 30, 2009 10:08 AM by PhHein RSS

    Mifare DESfire card Authentication!!!!!

    843851
      Does the Philips Mifare DESfire card authentication (3 pass) follows the standard CBC DES\3DES
      en-\decipher operations or are there some modifications.
      Any idea of CBC DES "send mode" & "receive mode" as stated in the card spec.
        • 1. Re: Mifare DESfire card Authentication!!!!!
          843851
          Look in "Mifare DES Fire Features and Hints V1.0". Chapter 2.3.3 contains the DES algorithms used by the DES Fire Card. If you use these algorithms an authentication will be possible.
          Be careful with the resultig session key. If you authenticate with a single DES the session key will also be a single DES. (Copy the first 8 Bytes into the following 8 Bytes)

          Good luck!
          • 2. Re: Mifare DESfire card Authentication!!!!!
            843851
            Thats Great Sir
            Thank you
            Thanks for the help
            • 3. Re: Mifare DESfire card Authentication!!!!!
              843851
              Important observation: it is not the usual CBC computation.

              The second block of data is XOR'd before the DES. (I was told it is 'inverted CBC' -- RSA's site says

              there are over 7 ways to do triple DES!). My CBC algorithms all XOR'd the data with previous block after

              the DES. The Philips documentation diagrams it correctly, but it's not obvious.

              So although your first block (rndA) will be correct (because ICV is 0's), your rndB' will not - and you get AE,

              authentication error.
              • 4. Re: Mifare DESfire card Authentication!!!!!
                843851
                Hi,can u please send me that 3DES decrypting algorithm for that 3-pass mutual Authentication.my mail id is sinu_ev@yahoo.com
                • 5. Re: Mifare DESfire card Authentication!!!!!
                  843851
                  Hello
                  I need help. I working with DesFire card.
                  I want to authenticate a card. Specifics of desfire card says that master key of card is 0x00(16 Bytes).So it means i have to use DES for enciphering/deciphering.

                  1-) Authenticate = > Send 0x0A(command) 0x00(KeyNo) Response => AF 91 79 BA 9A AE 1C 71 F2

                  So RNDB which enciphered with masterkey is => 91 79 BA 9A AE 1C 71 F2

                  2-)Then i deciphered RNDB(i used DES with init-vector 0x00(8 Bytes), master-key 0x00(8 Bytes)) so clear RNDB = > 0F 67 06 85 0E 2F A4 03

                  3-) Then I rotated left RNDB. RNDB' = > 67 06 85 0E 2F A4 03 0F

                  4-) I selected RNDA as 11 22 33 44 55 66 77 88

                  5-) (RNDA + RNDB') = > 11 22 33 44 55 66 77 88 67 06 85 0E 2F A4 03 0F

                  5-) I deciphered (RNDA + RNDB') value with using DES function mode CBC-1 and i obtained CD 72 DF C6 E6 D0 40 A4 63 15 30 22 6F 75 4F 8D

                  6-)As a final i sent this last value with 0xAF => AF CD 72 DF C6 E6 D0 40 A4 63 15 30 22 6F 75 4F 8D
                  and i got 0xAE that it means authenticate error.

                  Can You check this values? I don't know where is the fault.

                  Thanks very much for helping.
                  • 6. Re: Mifare DESfire card Authentication!!!!!
                    843851
                    Hello all,

                    Could you please help me with DESFire command set? I was not able to find any documents describing DESFire command set anywhere, If you have such document could you please let me know where I can get it.

                    Thanks in advance
                    • 7. Re: Mifare DESfire card Authentication!!!!!
                      843851
                      Hello.

                      Write you e-mail. I will send for you DesFire card documents.
                      • 8. Re: Mifare DESfire card Authentication!!!!!
                        843851
                        Hi can someone please send this document: "Mifare DES Fire Features and Hints V1.0". on email tsoldo@gmail.com
                        Thanks
                        • 9. Re: Mifare DESfire card Authentication!!!!!
                          843851
                          HI Can someone send me the "Mifare DES Fire Features and Hints V1.0". doc also to ftb06600 at gmail.com

                          thanks
                          • 10. Re: Mifare DESfire card Authentication!!!!!
                            843851
                            Hello All,

                            Could you give me the Mifare DESFire document??? Thanks
                            email: nganphanthu@gmail.com
                            • 11. Re: Mifare DESfire card Authentication!!!!!
                              843851
                              Hello All
                              Could you give me Mifare DES Fire Features and Hints V1.0 document
                              at my email address ym.albert.ks@gmail.com

                              because I cannot solve reading desfire ev1
                              using iso 14443
                              i already select the card an get the 7 digit serial number
                              and it done.
                              But when i am doing RATS command and APDU command it doesnt work.

                              I am using ACR120U reader and i Already succeess reading mifare philps 4k using the API.
                              But when i do it in the DESfire EV1 thats cannot worked
                              this are the steps that i done:

                              import acs.jni.ACR120U;

                              public class ConnectDesfire {

                              ACR120U deviceReadDesf;
                              byte rSerialNumber;

                              public ConnectDesfire()
                              {
                              deviceReadDesf = new ACR120U();
                              rSerialNumber = new byte[10];


                              short conn= deviceReadDesf.open(ACR120U.ACR120_USB1); // succsess
                              if(conn != 0) System.out.println("Error with code "+conn);

                              short valueSelect = deviceReadDesf.select(conn, new byte[1],
                              new byte[1], rSerialNumber); // Success
                              if(valueSelect != 0) System.out.println("Error with code "+valueSelect );

                              // rats
                              byte fsdi = 1 ;
                              byte atslen[] = new byte[1];
                              byte[] ats = new byte[16];
                              short resRats = deviceReadDesf.rATS(conn, fsdi, atslen, ats); // failed dont khow why error -3030
                              if(resRats != 0) System.out.println("Res Rats failed = " + resRats);

                              //apdu
                              byte rData[] = new byte[16];
                              xLen[0] = 0;
                              xData[0] = (byte) Integer.valueOf("60", 16).shortValue();
                              rLen[0] = 0;
                              rData[0] = 0;
                              short resAPDU=deviceReadDesf.xchAPDU(ACR120U.ACR120_USB1, true, xLen, xData, rLen, rData);
                              if(resAPDU !=0) System.out.println("Failed xchAPDU val= "+con);
                              // failed error -13.... sory i forgot the code

                              closeConnection(ACR120U.ACR120_USB1);
                              }

                              public static void main(String[] args)
                              {

                              ConnectDesfire a = new ConnectDesfire();
                              }
                              }


                              So could you share the document Mifare DES Fire Features and Hints V1.0 to me?
                              • 12. Re: Mifare DESfire card Authentication!!!!!
                                843851
                                hi all,
                                Can someone send me the Mifare DES Fire Features and Hints V1.0 ?
                                my email address is swekuang@gmail.com
                                THanks alot!!
                                Kelvin
                                • 13. Re: Mifare DESfire card Authentication!!!!!
                                  843851
                                  Hi.

                                  Send me please the Mifare DESFire Features and Hints V1.0 email address is green_troll(at)rambler.ru

                                  best regards.
                                  • 14. Re: Mifare DESfire card Authentication!!!!!
                                    843851
                                    Hi,
                                    I need some help with mifare desfire application commands.
                                    Can someone please send this document to me:
                                    "Mifare DES Fire Features and Hints V1.0"
                                    email: irena@otiglobal.com
                                    Thanks
                                    1 2 Previous Next