php-snapchat icon indicating copy to clipboard operation
php-snapchat copied to clipboard

Stories Decryption

Open nmock opened this issue 11 years ago • 6 comments

I'm having issues with the stories decryption (snaps are still okay), have Snapchat's encryption methods changed or are other people experience the same issue? Any ideas as to what they're doing now?

nmock avatar Nov 30 '14 02:11 nmock

In my case, it wasn't the decryption. but the HTTP Request

pass only the story_id to the get request and nothing else. worked!

oliverbytes avatar Nov 30 '14 03:11 oliverbytes

No, they haven't changed. Take a look at #45 it's quite similar to your issue but it's for a thumbnail.

Hope this helps.

hako avatar Nov 30 '14 03:11 hako

@NemOry, I am rolling my own implementation and tried this, I am mimicking the request exactly from Snapchat. I am getting back an encrypted blob, but am unable to decrypt it properly using the included keys from the initial request.

@hako I tried this as well (directly from this repo), but ran into the same issues as the OP...here is my code (with the actual values filled in): $data = $snapchat->getStoryThumb('media_id', 'media_key', 'media_iv'); file_put_contents('thumbnail.png', $data);

When I go to open the PNG file, it is invalid.

nmock avatar Nov 30 '14 04:11 nmock

My decryption implementation still works. but I am talking about the QT/C++ implementation. I don't use this PHP Lib

oliverbytes avatar Nov 30 '14 04:11 oliverbytes

Here is my Obj-C implementation: https://gist.github.com/nmock/a7fa590f1d835a88a9f8

I am unsure what I am doing wrong, I have tried combinations of Base64 encoding/decoding options and AES decryption options, but the decrypted data is not valid.

nmock avatar Nov 30 '14 05:11 nmock

Also, just in trying to decode the key/iv as a test in Python using the latest values from the stories API, using the same code from the GibSec Full Disclosure, it does not seem to be decoding properly (produce any output):

http://ideone.com/IPxQfy

Any ideas what's going wrong here?

nmock avatar Dec 01 '14 04:12 nmock