Topic: How can I lock authentication key for writing in Ultralight C tags?

I have updated the authentication key of the ultralight C tag. After that i am able to authenticate and read/write successfully. I need to know what command i will send to tag to lock the authentication key sectors i.e 44,45,46,47 for writing. Though I am doing it in C# but any example in java can also help me to identify what exact data i will write to block 40 (which consists of lock configuration i think)

Re: How can I lock authentication key for writing in Ultralight C tags?

Hello,

kamii47 wrote:

I need to know what command i will send to tag to lock the authentication key sectors i.e 44,45,46,47 for writing.

RTFM smile

You should find what you are looking for in Ultralight C manual.

kamii47 wrote:

Though I am doing it in C#

Which library do you use ?

Romuald Conty

3 (edited by kamii47 2015-05-05 06:06:40)

Re: How can I lock authentication key for writing in Ultralight C tags?

I have read the manual and try to lock the area. I have used native WinScard.dll via dll import in C#
I have tried with command
int j = obj.Write((byte)42, new byte[] { 0x1E, 0x00, 0x00, 0x00 });
I have posted here as some forum post helped me in finding the correct apdu command for authentication as well a while back

4 (edited by kamii47 2015-05-08 06:38:48)

Re: How can I lock authentication key for writing in Ultralight C tags?

I were able to lock the are for read and write.What additional thing i have to do is change some configuration in 43 page
Following is my code (posting here so it might help other's)
bool issuccess;
if(UltralightCAuth())
{
int j = obj.Write((byte)43, new byte[] { 0x00, 0x00, 0x00, 0x00 });
if (j == 0)
{
   j = obj.Write((byte)42, new byte[] { 0x1E, 0x00, 0x00, 0x00 });
}
issuccess = j == 0;
}