RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.65k stars 981 forks source link

Support other MFC JSON Key file formats (Metrodroid) #886

Open iceman1001 opened 4 years ago

iceman1001 commented 4 years ago

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

doegox commented 4 years ago

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

iceman1001 commented 4 years ago

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

iceman1001 commented 4 years ago

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 :)

merlokk commented 4 years ago

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

iceman1001 commented 4 years ago

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

merlokk commented 4 years ago

there may be 2 type of files:

iceman1001 commented 4 years ago

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.