richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

Add decryption support #83

Closed kiike closed 8 years ago

kiike commented 8 years ago

This PR adds decryption support to the PB base class. It is based on both the Cryptography examples on AES-GCM decryption and Pushbullet's API examples. I tried to make it work as similarly as your encryption method.

I have been using it this afternoon and have this screencast showing it in action in my pushbullet.py-based PB client.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-2.2%) to 53.202% when pulling f77f5576b21f211de4dd41d1e371787de8a6ba65 on kiike:pr-decryption into b6cd31db657dbebdcd6955d354fda1e709cb8740 on randomchars:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+3.2%) to 58.621% when pulling 40559b9852d3e090a037155979dfa2797a339063 on kiike:pr-decryption into b6cd31db657dbebdcd6955d354fda1e709cb8740 on randomchars:master.

kiike commented 8 years ago

I have written a unit test, but it overwrites the key so that we don't use the pushbullet.py-generated key. The reason is that pushbullet.py creates a key with a salt which is different to that in the pushbullet docs. In order to make this test consistent with the Pushbullet docs, I have overriden the key with the one in the docs.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+3.2%) to 58.621% when pulling abbe9f51bb995b1eb789c769164494c0933b97f1 on kiike:pr-decryption into b6cd31db657dbebdcd6955d354fda1e709cb8740 on randomchars:master.

kiike commented 8 years ago

Oh, all these @coveralls messages mean that I rebased the commits into one that made more sense and it got a little bit too verbose before the rebasing.