Reply To: Authentication Problem Desfire EV1 with AES

Forum MIFARE SDK Authentication Problem Desfire EV1 with AES Reply To: Authentication Problem Desfire EV1 with AES

Re: Authentication Problem Desfire EV1 with AES

14. January 2017 at 9:21
Hello,

yes I'm using the TapLinx SDK. I'm providing a little bit more of my code. Just changed the key value for this post.
The error (error:0606508A:digital envelope routines:EVP_DecryptFinal_ex:data not multiple of block length)
occurs at the all of the authenticate method.

I'm testing on a Samsung Galaxy s5 mini(SM-G800F) with android 5.1.1

mCardType = CardType.DESFireEV1;
desFireEV1 = DESFireFactory.getInstance().getDESFire(m_libInstance.getCustomModules());

try {

desFireEV1.getReader().connect();
desFireEV1.getReader().setTimeout(2000);
desFireEV1.selectApplication(1);

byte[] KEY_AES = {
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,
(byte) 0x00,

};


Key key = new SecretKeySpec(KEY_AES, "AES");
KeyData keyData = new KeyData();
keyData.setKey(key);
desFireEV1.authenticate(0, IDESFireEV1.AuthType.AES, KeyType.AES128, keyData);
showMessage("authenticated", 't');


} catch (NxpNfcLibException ex ){
showMessage(ex.getMessage(),'t');
}
break;
+ 0  |  - 0