Advertisement
hiviah

Two ways to read NDEF message

Apr 10th, 2018
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.79 KB | None | 0 0
  1. #Two versions of reading NDEF message, one with wrapped Desfire commands (Desfire specific, other with standard ISO 7816 commands)
  2.  
  3. #Desfire example with OpenSC:
  4. opensc-tool -s "90 5a 00 00 03 01 00 00 00" -s "90 bd 00 00 07 02 00 00 00 2b 00 00 00"
  5.  
  6. #Sample output:
  7. #   Using reader with a card: ACS ACR122U PICC Interface 00 00
  8. #   Sending: 90 5A 00 00 03 01 00 00 00
  9. #   Received (SW1=0x91, SW2=0x00)
  10. #   Sending: 90 BD 00 00 07 02 00 00 00 2B 00 00 00
  11. #   Received (SW1=0x91, SW2=0x00):
  12. #   00 98 7B 22 62 72 6D 64 6F 6F 72 53 69 67 6E 61 ..{"brmdoorSigna
  13. #   74 75 72 65 22 3A 20 22 31 63 32 35 33 64 36 65 ture": "1c253d6e
  14. #   35 64 30 33 34 64 34 30 64 37 64                5d034d40d7d
  15.  
  16.  
  17. #With standard ISO 7816 - note that the second command should depend on the first one for the location of NDEF file
  18. # read capability container
  19. opensc-tool -s "00 A4 04 00 07 D2760000850101" -s "00 A4 00 0C 02 E103" -s "00 b0 00 00 0f"
  20. # read ndef from file 0xe104
  21. opensc-tool -s "00 a4 04 00 07 D2760000850101" -s "00 a4 00 0c 02 E104" -s "00 b0 00 00 00"
  22.  
  23. #Sample output:
  24. #   Using reader with a card: ACS ACR122U PICC Interface 00 00
  25. #   Sending: 00 A4 04 00 07 D2 76 00 00 85 01 01
  26. #   Received (SW1=0x6A, SW2=0x82)
  27. #   Sending: 00 A4 00 0C 02 E1 03
  28. #   Received (SW1=0x90, SW2=0x00)
  29. #   Sending: 00 B0 00 00 0F
  30. #   Received (SW1=0x90, SW2=0x00):
  31. #   00 0F 20 00 3B 00 34 04 06 E1 04 1E 00 00 00 .. .;.4........
  32. #   Using reader with a card: ACS ACR122U PICC Interface 00 00
  33. #   Sending: 00 A4 04 00 07 D2 76 00 00 85 01 01
  34. #   Received (SW1=0x6A, SW2=0x82)
  35. #   Sending: 00 A4 00 0C 02 E1 04
  36. #   Received (SW1=0x90, SW2=0x00)
  37. #   Sending: 00 B0 00 00 00
  38. #   Received (SW1=0x90, SW2=0x00):
  39. #   00 98 7B 22 62 72 6D 64 6F 6F 72 53 69 67 6E 61 ..{"brmdoorSigna
  40. #   74 75 72 65 22 3A 20 22 31 63 32 35 33 64 36 65 ture": "1c253d6e
  41. #   35 64 30 33 34 64 34 30 64 37 64 39 64 31 31 31 5d034d40d7d9d111
  42. #   31 66 64 66 35 62 37 35 38 63 61 30 32 66 61 36 1fdf5b758ca02fa6
  43. #   36 64 31 35 32 33 36 65 61 61 66 37 61 31 38 34 6d15236eaaf7a184
  44. #   30 63 39 33 39 62 30 34 37 32 64 65 39 63 34 62 0c939b0472de9c4b
  45. #   64 63 61 63 32 38 31 63 36 66 36 34 32 62 36 30 dcac281c6f642b60
  46. #   32 66 35 38 62 63 65 66 66 66 33 32 38 30 39 33 2f58bcefff328093
  47. #   61 31 30 31 31 35 65 64 37 38 38 35 63 64 37 37 a10115ed7885cd77
  48. #   61 65 62 33 64 63 30 63 22 7D 00 00 00 00 00 00 aeb3dc0c"}......
  49. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  50. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  51. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  52. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  53. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  54. #   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement