Fixing readme for Python3 and adding requirements
This commit is contained in:
parent
50e12c4b8d
commit
8fba4bba40
|
@ -103,7 +103,7 @@ As an example, to check if the key `000102030405060708090A0B0C0D0E0F` is used to
|
|||
>>> pkt = LoRa(binascii.unhexlify(p))
|
||||
>>> pkt
|
||||
<LoRa Preamble=0x0 PHDR=0x0 PHDR_CRC=0x0 MType=Join-request RFU=0 Major=0 Join_Request_Field=[<Join_Request AppEUI='lovecafe' DevEUI='meeetoo' DevNonce=26985 |>] MIC=0x53024c49 |>
|
||||
>>> checkMIC(binascii.unhexlify(key), str(pkt))
|
||||
>>> checkMIC(binascii.unhexlify(key), bytes(pkt))
|
||||
True
|
||||
```
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ def checkMIC(key, hexpkt, direction=1):
|
|||
except Exception:
|
||||
mic = binascii.hexlify(mic)
|
||||
cmic = bytes(getPHY_CMAC(key, hexpkt), 'utf-8')
|
||||
print (repr(mic), repr(cmic))
|
||||
return (mic == cmic)
|
||||
|
||||
# TODO: more helpers
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
pycryptodome
|
||||
scapy
|
Loading…
Reference in New Issue