{"id":13673746,"url":"https://github.com/jieter/python-lora","last_synced_at":"2025-04-05T06:07:35.018Z","repository":{"id":5503838,"uuid":"53316778","full_name":"jieter/python-lora","owner":"jieter","description":"Decrypt LoRa payloads in python.","archived":false,"fork":false,"pushed_at":"2024-10-28T09:50:15.000Z","size":69,"stargazers_count":69,"open_issues_count":2,"forks_count":18,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T20:45:35.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jieter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-07T10:27:45.000Z","updated_at":"2025-03-05T07:48:53.000Z","dependencies_parsed_at":"2024-01-17T04:41:23.166Z","dependency_job_id":"3121ebe4-c26a-439c-a433-53c11e5c94e0","html_url":"https://github.com/jieter/python-lora","commit_stats":{"total_commits":70,"total_committers":3,"mean_commits":"23.333333333333332","dds":"0.24285714285714288","last_synced_commit":"5452c5aad29247d1bb0c1c57b409c976592a4190"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jieter%2Fpython-lora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jieter%2Fpython-lora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jieter%2Fpython-lora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jieter%2Fpython-lora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jieter","download_url":"https://codeload.github.com/jieter/python-lora/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294538,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T11:00:21.062Z","updated_at":"2025-04-05T06:07:35.001Z","avatar_url":"https://github.com/jieter.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# python-lora\n\nPython wrapper for LoRa payloads from Thingpark/Actility, allowing decryption of the payload.\n\n- Depends on [cryptography]\n- Based on crypto code in [Lora-net/LoRaMac-node]\n- Tested with python 3.8, 3.9, 3.10, 3.11\n- Available on [pypi]\n\n## Usage\n\n`pip install python-lora`\n\n[cryptography] requires [cffi] which in turn requires `libffi-dev` and `python-dev`.\n\n```python\nfrom lora.payload import LoRaPayload\n\nxmlstr = '''\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cDevEUI_uplink xmlns=\"http://uri.actility.com/lora\"\u003e[...]\n\u003cFCntUp\u003e2\u003c/FCntUp\u003e[...]\n\u003cpayload_hex\u003e[...]\u003c/payload_hex\u003e[...]\n\u003c/DevEUI_uplink\u003e'''\n\npayload = LoRaPayload(xmlstr)\n\nkey = 'AABBCCDDEEFFAABBCCDDEEFFAABBCCDD'\ndev_addr = '00112233'\nplaintext = payload.decrypt(key, dev_addr)\n```\n\nYou can also use `loramac_decrypt` without the XML wrapper to decode a hex-encoded `FRMPayload`:\n```python\n\u003e\u003e\u003e from lora.crypto import loramac_decrypt\n\u003e\u003e\u003e payload = '11daf7a44d5e2bbe557176e9e6c8da'\n\u003e\u003e\u003e sequence_counter = 2\n\u003e\u003e\u003e key = 'AABBCCDDEEFFAABBCCDDEEFFAABBCCDD'\n\u003e\u003e\u003e dev_addr = '00112233'\n\u003e\u003e\u003e loramac_decrypt(payload, sequence_counter, key, dev_addr)\n[222, 59, 24, 8, 7, 155, 237, 158, 103, 125, 93, 34, 161, 204, 33]\n```\n\n[cryptography]: https://cryptography.io/\n[cffi]: https://cffi.readthedocs.org/en/latest/\n[pypi]: https://pypi.python.org/pypi/python-lora\n[Lora-net/LoRaMac-node]: https://github.com/Lora-net/LoRaMac-node/blob/master/src/mac/LoRaMacCrypto.c#L108\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjieter%2Fpython-lora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjieter%2Fpython-lora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjieter%2Fpython-lora/lists"}