MIFARE SDK Light + DESFire card: personalize method throws “authenticateAES” exception on some devices

Forum / MIFARE SDK / MIFARE SDK Light + DESFire card: personalize method throws “authenticateAES” exception on some devices

  • 4. December 2014 at 16:02
    Hi,
    I'm creating an application that stores some data on the CARD. It works fine on LG G2, Xperia Z, Samsung Galaxy S4.
    Unfortunately there is a problem on other devices (so far tested with Nexus 4 and Nexus 7 2013). The "personalize" method throws the exception attached below.

    Any ideas how to fix it?

    ---------------------------------------------
    Caused by: com.nxp.nfclib.exceptions.DESFireException: authenticateAES
    at com.nxp.nfclib.desfire.DESFire.authenticate(:1297)
    at com.nxp.nfcliblite.cards.DESFire.personalize(:520)
    at com.liebherr.servicetool.card.DesifreCardNxpLibrary.createApplication(DesifreCardNxpLibrary.java:113)
                at com.liebherr.servicetool.cardkeystore.DesfireKeystore.writeKeys(DesfireKeystore.java:65)
                at com.liebherr.servicetool.activity.ProgramCardActivity.testSavingKeysOnCard(ProgramCardActivity.java:237)
                at com.liebherr.servicetool.activity.ProgramCardActivity.perform(ProgramCardActivity.java:375)
                at com.liebherr.servicetool.activity.ProgramCardActivity.access$300(ProgramCardActivity.java:63)
                at com.liebherr.servicetool.activity.ProgramCardActivity$CardProgrammingTask.doInBackground(ProgramCardActivity.java:340)
                at com.liebherr.servicetool.activity.ProgramCardActivity$CardProgrammingTask.doInBackground(ProgramCardActivity.java:330)
                at android.os.AsyncTask$2.call(AsyncTask.java:287)
                at java.util.concurrent.FutureTask.run(FutureTask.java:234)
                at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
                at java.lang.Thread.run(Thread.java:841)
    Caused by: javax.crypto.IllegalBlockSizeException: error:0606508A:digital envelope routines:EVP_DecryptFinal_ex:data not multiple of block length
    at org.apache.harmony.xnet.provider.jsse.NativeCrypto.EVP_CipherFinal_ex(Native Method)
    at org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.doFinalInternal(OpenSSLCipher.java:398)
    at org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:434)
    at javax.crypto.Cipher.doFinal(Cipher.java:1111)
    at com.nxp.nfclib.desfire.DESFire.?(:6865)
                at com.nxp.nfclib.desfire.DESFire.authenticate(:1297)
                at com.nxp.nfcliblite.cards.DESFire.personalize(:520)
                at com.liebherr.servicetool.card.DesifreCardNxpLibrary.createApplication(DesifreCardNxpLibrary.java:113)
                at com.liebherr.servicetool.cardkeystore.DesfireKeystore.writeKeys(DesfireKeystore.java:65)
                at com.liebherr.servicetool.activity.ProgramCardActivity.testSavingKeysOnCard(ProgramCardActivity.java:237)
                at com.liebherr.servicetool.activity.ProgramCardActivity.perform(ProgramCardActivity.java:375)
                at com.liebherr.servicetool.activity.ProgramCardActivity.access$300(ProgramCardActivity.java:63)
                at com.liebherr.servicetool.activity.ProgramCardActivity$CardProgrammingTask.doInBackground(ProgramCardActivity.java:340)
                at com.liebherr.servicetool.activity.ProgramCardActivity$CardProgrammingTask.doInBackground(ProgramCardActivity.java:330)
                at android.os.AsyncTask$2.call(AsyncTask.java:287)
                at java.util.concurrent.FutureTask.run(FutureTask.java:234)
                at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
                at java.lang.Thread.run(Thread.java:841)
    + 0  |  - 0

    Re: MIFARE SDK Light + DESFire card: personalize method throws “authenticateAES” exception on some devices

    9. December 2014 at 14:43
    Dear mack23,

    The Nexus 4 and 7 devices uses a Broadcom NFC reader which is not full certified for using MIFARE DESFire products (for Android devices with NXP NFC readers this problem should not occur). With updates this problem should be fixed:

    Nexus 7 Android Version 4.4.4
    Nexus 5 Android Version 5.0
    Nexus 4 Android Version 5.0

    We suggest you to update your Android device.

    Regards,
    The MIFARE SDK Team
    + 0  |  - 0
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.