diff --git a/readme.md b/readme.md index 7739b853..365a9160 100644 --- a/readme.md +++ b/readme.md @@ -6,13 +6,13 @@ This is the monorepo for PierMesh. # Docs -You can find the full docs here: [docs/](docs/) +You can find the full docs here: [docs/](https://git.utopic.work/PierMesh/piermesh/src/branch/main/docs) # How to use Note: these instructions will probably only work on Linux at the moment -Note: check the scripts to make sure they'll work with your system, and in general I reccomend checking scripts before you run them +Note: check the scripts to make sure they'll work with your system, and in general I recommend checking scripts before you run them Follow Meshtastic's guide on setting up your device: [https://meshtastic.org/docs/getting-started/](https://meshtastic.org/docs/getting-started/) Make sure you have the latest Python installed diff --git a/src/Cryptography/WhaleSong.py b/src/Cryptography/WhaleSong.py index a7dcbeeb..2c144284 100755 --- a/src/Cryptography/WhaleSong.py +++ b/src/Cryptography/WhaleSong.py @@ -257,6 +257,7 @@ class DHEFern: """ return os.urandom(16) + # TODO: Build in transport security (node/node) def encrypt(self, data, nodeID: str, isDict: bool = True): """ Do Fernet encryption diff --git a/src/Packets/Message.py b/src/Packets/Message.py index de82aef3..1651dc1d 100755 --- a/src/Packets/Message.py +++ b/src/Packets/Message.py @@ -27,6 +27,7 @@ class Message: senderDisplayName: int, recipient: int, recipientNode: int, + cryptographyInfo, dataSize: int = 128, wantFullResponse: bool = False, packetsClass: int = 0, @@ -71,7 +72,10 @@ class Message: ) self.packets = packets else: - bytesObject = lzma.compress(bytesObject) + # Data passed in by peers should already have been e2ee encrypted by SubtleCrypto + # Transport encryption + # bytesObject = lzma.compress(bytesObject, str(recipientNode).zfill(6), isDict=False) + bytesObject = cryptographyInfo.encrypt(bytesObject, self.no) packets = [] self.packetsID = random.randrange(0, 999999) pnum = 1 diff --git a/src/Transceiver/Transceiver.py b/src/Transceiver/Transceiver.py index 4cefa5cc..5a943496 100644 --- a/src/Transceiver/Transceiver.py +++ b/src/Transceiver/Transceiver.py @@ -227,6 +227,7 @@ class Transceiver: senderName, recipient, recipientNode, + self.cryptographyInfo, packetsClass=packetsClass, ) for p in tp.packets: