如何使用新的 e2e 加密功能加密通过 Pushbullet 发送的消息

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

对端到端加密的支持非常棒!我想使用 Pushbullet API 在我自己的 Python 应用程序中利用该功能。这可能吗?如果,比方说,我想发送一个简单的便条,我可以做类似的事情吗:

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)

encrypt 函数需要做什么?

我们支持 Notification Mirroring, Universal copy & paste, and SMS 的端到端加密。我们使用 AES256 + GCM 和使用 PBKDF2 派生的密钥。如何做到这一点的细节取决于你的加密库,但它对推送没有真正的帮助。

我们确实希望将来使用相同的东西为您自己的推送添加加密。推送给其他人将无法使用对称加密,因此我们需要非对称加密。