Reply To: Switching MiFare Plus to S3

Forum MIFARE SDK Switching MiFare Plus to S3 Reply To: Switching MiFare Plus to S3

Re: Switching MiFare Plus to S3

11. October 2016 at 17:21
Hi and thanks for the reply.

I realize that but my key is 16 Bytes in length if you take a look at my code which I posted before. I am not encrypting anything, I don't know exactly what happens when I use the command m_objPlusSL1.switchToSL3(keyData) from your library but I suspect it is doing something else since the only thing that I pass to it is my key (128 Bit AES) inside the KeyData instance that comes from your library.

This is the code that generates the key:

// Generate AES 128-Bit Key and save to File on first run
/*
final int keyLength = 128;
SecureRandom secureRandom = new SecureRandom();
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
keyGenerator.init(keyLength, secureRandom);
SecretKey aesKey = keyGenerator.generateKey();*/

File keyFileBin = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "key.bin");
// Save Key to Disk
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(keyFileBin));
bos.write(aesKey.getEncoded());
bos.flush();*/


+ 1  |  - 0