Authenticate against Ultralight C with TapLinx

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Authenticate against Ultralight C with TapLinx

777件の閲覧回数
stba
Contributor I

I am trying to use the TapLinx library on Java Desktop with Mifare Ultralight C.

I was able to program the security key with the method: 

ultralightC.program3DESkey()
 
I am also able to read data via RFIDDiscover with my key.
 
I am now struggeling with authentication programatically. What I have is this:
 
byte[] keyBytes = hexStringToByteArray(key);


byte[] keyBytes1 = new byte[24];
System.arraycopy(keyBytes, 0, keyBytes1, 0, 8);
System.arraycopy(keyBytes, 8, keyBytes1, 8, 8);
System.arraycopy(keyBytes, 0, keyBytes1, 16, 8);

SecretKeySpec twoKey3DES = new SecretKeySpec(keyBytes1, "TripleDES");
keyData.setKey(twoKey3DES);
ultralightC.authenticate(keyData);
 
However I get:
Exception in thread "main" java.lang.SecurityException: Authentication failed!
at com.nxp.nfclib.ultralight.UltralightC.a(Unknown Source)
at com.nxp.nfclib.ultralight.UltralightC.authenticate(Unknown Source)
at dev.netprint.closedloop.lib.TapLinxTest.main(TapLinxTest.java:38)
 
I cannot make the key only 16 bytes since it will then say the key is to short. How do I have to encode the according key so the authentication works?
タグ(1)
0 件の賞賛
返信
0 返答(返信)