Mfrc522 changing authentication key

Good morning forum,
I'm planning on doing a project on reading sector blocks from a mfrc522 Picc. As far as I know , we have to authenticate the block using a key to read them. I'm using the mfrc522 pcd. I've got 2 questions stuck in my mind.

  1. Can I change the key using the mfrc522 library?

  2. Is the key necessary for detecting wether a card is present?

Thank you

  1. Yes, you can if you have rfid cards that you can write to.

  2. No, you can program it however you want.

In the mfrc522 library there are plenty of examples to use as a base.

I could neither find the changing key function in the doc nor in Google. Can you guys suggest me an example which I can view into

Come on. The examples are in the library like I said in my previous post. There are only 10 examples in the library with clear titles. In every example is a description on what it does.

Basically you auth key A and B check accessbits and write sector trailer with new keys.
Messing it up will lock sector etc..

mfrc522.MIFARE_SetKeys(oldkeya, oldkeyb, newkeya, newkeyb, sector);

Thanks a lot guys

SteveP76:
Basically you auth key A and B check accessbits and write sector trailer with new keys.
Messing it up will lock sector etc..

mfrc522.MIFARE_SetKeys(oldkeya, oldkeyb, newkeya, newkeyb, sector);

I'm looking to change keys but I can't find this function in the library - or anywhere. Any help would be greatly appreciated.

HI,

has the function 'mfrc522.MIFARE_SetKeys' been with drawn? I have found exampleas using this scattered around, but it certainly is not in my copy of MFRC522.

This is the standard arduino library, I checked the .h file, and the examples and it isn't there...

Any suggestions, I have a project where I need to move away from common known keys.

Thanks Ian