Reply To: Problems creating a virtual card on a MIFARE4Mobile capable SE

Forum MIFARE general topics and applications Problems creating a virtual card on a MIFARE4Mobile capable SE Reply To: Problems creating a virtual card on a MIFARE4Mobile capable SE

Re: Problems creating a virtual card on a MIFARE4Mobile capable SE

20. November 2015 at 11:37
Hi Michael,

We currently have no special column for MIFARE4Mobile questions, so your post is correct here.

For the whole creation of the payload for the createVC command you need only a CMAC and an AES encryption function. This is the data block you enter with the createVC command, TLV 12.

Please notice that you can use different settings of the padding for the CMAC and encryption. I recommend not to use padding. In this case you have to set the input data in blocks of multiple of 8 bytes. For example the Wholesale Licence for a MIFARE Classic might be seven bytes. Concatenated with the pre-byte 01 you get the Derivation Input 1 which is eight bytes. The Derivation Input 1 is “maced” with the VC Creation Key (16 bytes) to the Wholesale VC Creation Key which has 16 bytes.

If you use the JCShell, then all calculations can be done very easily in the Shell. The Shell provides the embedded commands mac and encrypt for the calculation. You can write
/set-var CMAC_OUTPUT $(mac -m M7 -p NOPAD -k ${KEY} ${INPUT})

Here the variable
KEY
holds the key string,
INPUT
the input data string and
CMAC_OUTPUT
the CMAC of the operation.

Regards,
The MIFARE Team

+ 0  |  - 0