2

I'm trying to change the 3DES key on an Ultralight C card. I can write the the values in to the address 44-47 as I've found in some topics here. But I cannot authenticate when using it. If I write back the default key it works with no problems.

I think there's something I don't understand that's maybe the source of the problem, looking at the freefare library examples and in some posts from this and libnfc forum I've found the default key in ultralight C is: 425245414b4d454946594f5543414e21 (hex values for ASCII "BREAKMEIFYOUCAN!"), but for decryption it on client the key used 49454D4B41455242214E4143554F5946.

I don't know what's the relation between both keys, but I think some predified operation needs to be done in order to generate one from the other, and that's the cause of my failures. Did somebody had luck doing that? Every help is appreciated

For all my code I used this code as an starting point.

mwhs
  • 5,878
  • 2
  • 28
  • 34
Gaston Pisacco
  • 213
  • 1
  • 3
  • 10
  • Hi, 49454D4B41455242214E4143554F5946 is the Authentication key. You can take a look here to understand how it works.[link](http://nfc-live.googlecode.com/git-history/3441b20530fdabdc85df845a3c02f86a265f3efe/content_for_iso/app-ultralightc_jpsz/config/includes.chroot/etc/skel/ultralightC/ultralightC.pl) – VivienG Oct 09 '14 at 15:38

1 Answers1

0

Did you manage to solve your problem? Would you mind sharing your code with the community?

If you didn't, here are the premises:

If the hex key is: "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F" then you have to write the sequence "07 06 05 04 03 02 01 00 0F 0E 0D 0C 0B 0A 09 08" in 4 pages, from page 0x2C (44) to page 0x2F (47).

if you want to change where (which pages) the authentication is required, here is how to do that:

  • 0x2A defines the page address from which the authentication is required. E.g. if 0x2A = 0x30 no authentication is needed all as memory goes up to 0x2F.
  • 0x2B defines if authentication is required for read/write (0x2B=0) or only for write access (0x2B=1)
pedrofialho
  • 147
  • 1
  • 11