proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

Support other MFC JSON Key file formats (Metrodroid)

Open iceman1001 opened this issue 4 years ago • 7 comments

The app Metrodroid, has its own json key format file. It would be nice if we could load/save to that format aswell

Ref https://github.com/metrodroid/metrodroid/wiki/Importing-MIFARE-Classic-keys

It has some features.
"KeyType": "MifareClassic", "KeyType": "MifareClassicStatic",

Also some other interesting concepts as

  • Transform (to hint to use a specific keygen algo)
  • Bundle (to hint that if first key works, try same bundle keys first)

iceman1001 avatar Dec 01 '19 10:12 iceman1001

Interesting, but could be hard to re-label existing keys.

doegox avatar Dec 01 '19 10:12 doegox

Since we don't have a json format for mfc key files yet, we would be very free in the implementation :)

iceman1001 avatar Dec 01 '19 11:12 iceman1001

Add all known keygens and groups (bundles) of keys would be time consuming but really nice.. We would get a free ride from Metrodroid stuff :)

iceman1001 avatar Dec 01 '19 11:12 iceman1001

I think we can think of general format for storing keys. it can be like this:

  "KeyType": "MifareClassicStatic",
  "Description": "a human-readable label",
  "keys": [
    {
      "type": "KeyA",          /* or "KeyB" */
      "key": "010203040506",   /* 6 byte, Base16 encoded string of the key for sector 0 */
      "sector": 0,             /* sector this key applies to. and here can be not only sector... */
      "transform": "none"      /* default behaviour: perform no transformation */
    },

but..

as for mf plus the keys can be 16 bytes long and some of the keys is not belongs to sector they have only key number. needs to add KeyNum to some keys there

as for mf ultralight - it have 1 key as i remembered

as for ntag - i dont know...

t5577 - 1 key

iso15693 - dont know

merlokk avatar Dec 04 '19 11:12 merlokk

  • iClass = 8bytes , 2keys,
  • MFC Mifare Classic MINI/S50/S70, different amount of keys
  • MFU Mifare ultralight type

The "keys" section will always be strongly dependent on the "keytype" section to tell the consuming software how to use the keys included.

iceman1001 avatar Dec 04 '19 12:12 iceman1001

there may be 2 type of files:

  • key list (here will be no sectors or transformations or key A/B)
  • keys from cards with some data (maybe) (here exact sectors and transforms)

merlokk avatar Dec 04 '19 13:12 merlokk

I started to extract and refactor the key gen algo functions into common/generator.c
This should enable the idea of transform in a json key template format.

iceman1001 avatar Jan 02 '20 12:01 iceman1001