Forum / MIFARE SDK / com.nxp.nfclib.exceptions.InvalidResponseLengthException Parameter Error
-
Hello,
I am trying to read a desire EV2 card using the sample app provided. but when I am trying to authenticate the application it throws this com.nxp.nfclib.exceptions.InvalidResponseLengthException Parameter Error everytime. can you please help with what's wrong. here is my code snippet
desFireEV2.selectApplication(0);
KeyData desKeyDataDefault = new KeyData();
Key key = new SecretKeySpec(SampleAppKeys.KEY_AES128, "AES");
desKeyDataDefault.setKey(key);
int[] appIds = desFireEV2.getApplicationIDs();
for (int appId : appIds) {
byte[] fileIds = desFireEV2.getFileIDs();
for (byte fileId : fileIds) {
desFireEV2.authenticate(appId, IDESFireEV1.AuthType.AES,KeyType.AES128,desKeyDataDefault);
byte[] data = desFireEV2.readData(fileId, 0, 0,IDESFireEV1.CommunicationType.Enciphered,16);
}
}
It throws error at desFireEV2.authenticate() method. Please help
+ 0 | - 0
Hi Huzefa,
It seems that you use the wrong cipher. If the card is blank (not initialized before) the key is a 2K3DES key. Using a AES cipher, you must change the key from 2K3DES to AES.
The TapLinx team
+ 0 | - 0
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.