Search code examples
pushbullet

How do I encrypt a message to send via Pushbullet using the new e2e encryption feature


Support for end-to-end encryption is awesome! I'd like to take advantage of the feature in my own Python app using the Pushbullet API. Is this possible? If, say, I wanted to send a simple note, could I do something like:

import json
import requests

headers = {'content-type':'application/json', 'Authorization': 'Bearer <my-key>'}
note = {'type':'note', 'title':'Testing 1, 2, 3', 'body':'Hello World!'}
cyptNote = encrypt(note)
requests.post('https://api.pushbullet.com/v2/pushes', headers=headers, json=cyptNote)

What would the encrypt function need to do?


Solution

  • We support end-to-end encryption for Notification Mirroring, Universal copy & paste, and SMS. We use AES256 + GCM with the key derived using PBKDF2. The specifics of how to do that depend on your crypto libraries, but it won't really help for pushes.

    We do hope to add encryption for pushes to yourself in the future using the same stuff. Pushes to other people won't be able to use symmetric encryption so we'd need asymmetric encryption for that.