Open iceman1001 opened 4 years ago
Interesting, but could be hard to re-label existing keys.
Since we don't have a json format for mfc key files yet, we would be very free in the implementation :)
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 :)
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
The "keys" section will always be strongly dependent on the "keytype" section to tell the consuming software how to use the keys included.
there may be 2 type of files:
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.
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