Skip to content

Instantly share code, notes, and snippets.

@jeedee
Created May 10, 2010 14:39
Show Gist options
  • Save jeedee/396104 to your computer and use it in GitHub Desktop.
Save jeedee/396104 to your computer and use it in GitHub Desktop.
KEY = ['4E', '65', '78', '6F', '6E', '49', '6E', '63', '2E']
def self.decrypt(packet, increment)
0.upto(packet.length-1) do |i|
packet[i] = (packet[i] ^ (KEY[i % 9].hex))
packet[i] = (packet[i] ^ (i/9) )
packet[i] = (packet[i] ^ increment)
end
#todo optimize conversion
return packet.map {|x| x.to_s(16).hex.chr}.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment