Skip to content

Instantly share code, notes, and snippets.

@adnils
Created March 5, 2014 12:07
Show Gist options
  • Save adnils/9365973 to your computer and use it in GitHub Desktop.
Save adnils/9365973 to your computer and use it in GitHub Desktop.
lol snapchat
require 'openssl'
ARGV.each do|a, index|
data = File.open(a, '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) }
o += c.final
File.open('decyphered_' + a , 'w') { |f| f.write(o) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment