https://github.com/python273/pwngrid-api
Pwnagotchi's Pwngrid API client (⌐■_■)
https://github.com/python273/pwngrid-api
cryptography pwnagotchi python
Last synced: about 2 months ago
JSON representation
Pwnagotchi's Pwngrid API client (⌐■_■)
- Host: GitHub
- URL: https://github.com/python273/pwngrid-api
- Owner: python273
- License: mit
- Created: 2019-10-23T19:32:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T07:44:12.000Z (over 2 years ago)
- Last Synced: 2024-10-10T09:32:31.151Z (7 months ago)
- Topics: cryptography, pwnagotchi, python
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pwngrid-api
[](https://pypi.org/project/pwngrid-api/) 
[Pwnagotchi](https://pwnagotchi.ai/)'s Pwngrid API client (⌐■_■)
- https://pwnagotchi.ai/api/grid/
```
$ pip install pwngrid-api
```## Example
```python
import pwngrid_apitry:
private_key = pwngrid_api.utils.load_key("./id_rsa_client")
except FileNotFoundError:
private_key = pwngrid_api.utils.gen_key()
pwngrid_api.utils.save_key(private_key, "./id_rsa_client")pwngrid = pwngrid_api.PwngridClient("pygotchi", private_key)
print(pwngrid.unit.identity)pwngrid.enroll()
pwngrid.send_message(
recipient="94b67781c4057533d2e2700a9fcce924fbcfc0abf57724415ebc6819a51e4e39",
cleartext=b"Hello World!",
)for m in pwngrid.get_inbox()["messages"]:
data, cleartext, sender = pwngrid.read_message(m["id"])
print(sender.identity, cleartext.decode("utf-8"))
```