https://github.com/python273/pwngrid-api
Pwnagotchi's Pwngrid API client (⌐■_■)
https://github.com/python273/pwngrid-api
cryptography pwnagotchi python
Last synced: 8 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T07:44:12.000Z (about 3 years ago)
- Last Synced: 2025-05-07T06:04:57.289Z (8 months ago)
- Topics: cryptography, pwnagotchi, python
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 4
- Watchers: 1
- 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_api
try:
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"))
```