Solved

Mifare access bits hex to binary covnersion

Posted on 2011-02-14
3
2,916 Views
Last Modified: 2012-05-11
Hi,
I am trying to understand the conversion of binary code into hex for access bits on mifare cards. Nxp has plenty of free pages on this but I'm obviously missing some under standing on how the values in the documents relate to what is programed into the card e.g Ff0708 converts to C1 c2 c3 which equals the binary value of 001
I'm sure I'm not giving enough info so ask and I will answer where I can
Thanks
0
Comment
Question by:monitorwa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:kraiven
ID: 34887208
I'm afraid I don't know anything about the card you are using and I really don't understand how the Hex you gave gets to 001. But the general rule for converting Hex to binary is the each Hex number is equivalent to 4 binary values:

i.e. F (Hex) = 1 1 1 1 (Bin) = 15 (Dec)
      1 (Hex) = 0 0 0 1 (Bin) = 1 (Dec)
      2 (Hex) = 0 0 1 0 (Bin) = 2 (Dec)
      4 (Hex) = 0 1 0 0 (Bin) = 4 (Dec)
      8 (Hex) = 1 0 0 0 (Bin) = 8 (Dec)
      A (Hex) = 1 0 1 0 (Bin) = 10 (Dec)

hope that helps
0
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 500 total points
ID: 34890071
Most of what I'm using can be found on page 12 of this document
http://www.nxp.com/acrobat_download2/other/identification/m043531.pdf

The order of the bits and bytes isn't quite lining up so I'm not sure if I have the right specification document, but yours is at least very similar.

The C1 C2 C3 that you are referring to are the sector trailer. The hex code you have posted is the entirety of the access bits. The are split into 4-bit pieces in the discussion. Half the code is the exact same as the other half except all the bits are inverted (0->1 and 1->0).

Ff0708 = 1111 1111 0000 0111 0000 1000
As you can see, 0111 is the inverse of 1000 as are 1111 and 0000

The C1, C2, and C3 are the highest order bits in their respective characters.
It appears that the 0000, 0000, and 1000 are the characters for C1C2C3. So since the first bits in each are 0, 0, and 1 then C1C2C3 = 001. The other bits mean other things.
0
 

Author Closing Comment

by:monitorwa
ID: 34902714
Thanks your advices got me through it, on the actualy Mifare 1 k classic which is the card concerned C1 - C3 actually have 4 values each e.g C1 (0-3) so C1(2) - C3(2) reltae to different blocks of the card. I used your method for the rest and it worked out OK

thanks again

Dave
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Simple Random Sample 2 65
Least Squares Curve Fitting 4 133
Odds of picking games correctly 4 179
Internet Upload/Download. Need my math checked. 12 41
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question