Skip to content

Instantly share code, notes, and snippets.

View dtwaling's full-sized avatar
💭
it's okay to fall apart sometimes - we all loves tacos n they do it ALL the time

duswali dtwaling

💭
it's okay to fall apart sometimes - we all loves tacos n they do it ALL the time
View GitHub Profile
@jamescmartinez
jamescmartinez / snapchat_decrypt.rb
Last active August 13, 2023 20:23
Snapchat Image Decrypt - This Ruby script decrypts the blob received from the `bq/blob` endpoint. Many thanks to @kivikakk, @adamcaudill, @tlack, and @NeilHanlon for inspiration, code, guides, and of course, the encryption key.
#!/usr/bin/env ruby
require 'openssl'
data = File.open('blob', 'r:ASCII-8BIT').read
c = OpenSSL::Cipher.new('AES-128-ECB')
c.decrypt
c.key = 'M02cnQ51Ji97vwT4'
o = ''.force_encoding('ASCII-8BIT')
data.bytes.each_slice(16) { |s| o += c.update(s.map(&:chr).join) }