Skip to content

Instantly share code, notes, and snippets.

@alfredgamulo
Created January 20, 2014 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredgamulo/8514300 to your computer and use it in GitHub Desktop.
Save alfredgamulo/8514300 to your computer and use it in GitHub Desktop.
Schmoocon 2014 last stage blockchain http://www.shmoocon.org/badges/x/hkpzrake/
#!/usr/bin/ruby
def x2s(x)
ret = ""
if x.length > 2
while x.length >= 2
ret += x[0..1].hex.chr.to_s
x = x[2..-1]
end
ret += x[0..1].hex.chr.to_s
end
return ret
end
cipher =["eabf82c2","cad6eca4","f1f3f3a0","bcf5f2a5","bcdbafa2","a3d3e0e3","98d5abfe","8f92e2af","fb94e8fd","dad5f3e5","dae8f5a1","fba9e8ac","fb8ee9ad","bee3e9a4","edf2ade1","bfdaa3e2","a0c6a1e2","93d0e0ef","dfc4afbb","ead2fdfa","a5d9bce8","b0dfbae8","b6cdbdfd","f7cfa5b1","bedfe3b0","f590adfc","9c92ecf7","98c9e9a5","b48fbdb4","bedafcaf","a989fce7","b8c6bafd","a5d9b8b8","f1d7f4a7","bed4e4e2","eaddedae","b9c6eae9","a8dda3e9","a2c6b7ae","b0dcf5af"]
pad0 = "bedaeeae"
pad1 = pad0
answer = []
cipher.each_with_index { |thing,index|
pad1 = (cipher[index].hex ^ pad1.hex).to_s(16)
answer.push(x2s(pad1))
pad1 = (pad0.hex ^ pad1.hex).to_s(16)
}
puts answer.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment