Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5842579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:02:10+00:00 2026-05-22T12:02:10+00:00

It’s easy to protect a Mifare Ultralight with Android, there is the Ndef.makeReadonly() method

  • 0

It’s easy to protect a Mifare Ultralight with Android, there is the Ndef.makeReadonly() method for that. But Mifare Classic tags return Ndef.canMakeReadonly() == false, so this is not possible. I heard that one can make such a tag readonly or at least protect it with a key by setting the a or b keys.

There’s this methid in MifareClassic tech: authenticateSectorWithKeyB(int sectorIndex, byte[] key)

Does anyone know if this can be used to make a ndef message on a mifare classic tag read-only? Or how else could I write a ndef message onto the tag and then somehow lock it against new writes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:02:10+00:00Added an answer on May 22, 2026 at 12:02 pm

    It is possible using the authenticate methods.

    First, here is the datasheet for the Mifare Classic 4k:

    http://www.nxp.com/documents/data_sheet/MF1S703x.pdf

    The important chapters for your are:

    • 3.6 Memory Organization
    • 3.6.3 Sector Trailer

    In short a write protection works like this:

    The Mifare Classic is divided into sectors of 4*16 bytes each (only applies to the first 1k or so… the higher blocks are a bit different, but thats documented in the spec). Of these 64 bytes 16 are used for authentication/protection. For each sector of the card you do the following:

    1. Authenticate the sector using KeyA
    2. Read the sector trailer.
    3. Modify the access bits of the sector trailer.
    4. Write the sector trailer back to the card.

    The KeyA values for Mifare Classics are:

    byte[] KEY_DEFAULT =
    {(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF};

    For unformatted, factory fresh cards.

    byte[] KEY_MIFARE_APPLICATION_DIRECTORY =
    {(byte)0xA0,(byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5};

    For the first sector of the card

    byte[] KEY_NFC_FORUM =
    {(byte)0xD3,(byte)0xF7,(byte)0xD3,(byte)0xF7,(byte)0xD3,(byte)0xF7};

    For all other sectors.

    Important: You have to write back the original KeyA keys to the card. If these differ from the keys shown above the card will not be Ndef compliant anymore.

    For the modified access bits you have two choices:

    1. Only enable Read for KeyA. This will give you a 100% write protection that can’t be revoked.

    2. Enable Read for KeyA and Read/Write for KeyB. Also store a secret key in KeyB. This will allow you to authenticate a write protected sector using your secret KeyB to unprotect the card.

    Background: Android will only authenticate a Ndef formatted tag using the KeyA values shown above. The Ndef detection code never tries KeyB on its own, therefore you can use KeyB for your own purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.