You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a problem after writing to another block different than 0x01.
After writing to another block, i can't authenticate to previous the blocks that i have wrote data.
My code
fromnfcimportnfcasnfcReaderreader=nfcReader.Reader()
block_number=0x01custom_number=0x20key_location=0x01reader.load_authentication_data(key_location, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
reader.authentication(block_number, 0x61, key_location)
defwrite(position=block_number, number=custom_number, data=[0x00foriinrange(16)]):
""" Write data to mifare tag Example: write(reader, 0x01, 0x20, [0x00 for i in range(16)]) """whilenumber>=16:
write_16(reader, position, 16, data)
number-=16position+=1defwrite_16(r, position, number, data):
r.update_binary_blocks(position, number, data)
defread(position=block_number, number=custom_number):
""" Read data from mifare tag >>> read(reader, 0x01, 0x20) """print(f'block {block_number}')
result= []
whilenumber>=16:
result.append(read_16(position, 16, reader))
number-=16position+=1returnresultdefread_16(position, number, r):
returnr.read_binary_blocks(position, number)
The text was updated successfully, but these errors were encountered:
I'm facing a problem after writing to another block different than 0x01.
After writing to another block, i can't authenticate to previous the blocks that i have wrote data.
My code
The text was updated successfully, but these errors were encountered: