Mifare Classic & Ultralight Extension

Hi everybody,
I improved my extension and I added the support for Mifare Ultralight technology, it is different from Mifare Classic (obviously). There are 3 differents types of ultralight tags:

  • Ultralight (no authentication)
  • Ultralight C (3DES authentication)
  • Ultralight EV1 (32-bit password + password acknowledge)

The memory is divided into pages and each page is 4 bytes, in the memory there are some special bytes for the uid, for the password and so on, and obviously the bytes for the user.
For more information:

With this new extensions I added some functions and updated of old ones.

image
Get the UID of Mifare Classic and Mifare Ultralight

image
Get the Type of Mifare Classic and Mifare Ultralight

image
Offset number of the page to read.

image
Page contains the 4 pages read starting from the offset specified in the previous property

image
Write a page in a Mifare Ultralight Tag
Page: the page number of the tag
DataToWrite: the data (4bytes)

If Your tag is not protected You can use the functions above as are.
Instead if your tag is protected or You want to enable the authentication I developed the functions for Mifare Ultralight EV1 (for now)

image
Write the password (4bytes) and the pack (2bytes) in the special pages of the tag.
How does it work? When You try to authenticate if the password is correct the tag reply with the pack and if the pack has the value that You expect means that the tag is correct (the extension do the check for You)

image
After You wrote the Password and the Pack, You can enable the Protection starting from the page number.
Enable: true or false (enable or disable the protection)
PageNumber: usally 4 because is the first page for user data

image
The Password value to use when the tag is protected

image
The Pack value to use when the tag is protected

Obviously when the protection is enable You need to authenticate before to change the password, pack or disable the protection.

Best Regards
Marco

8 Likes