Skip to content

Instantly share code, notes, and snippets.

@robbestad
Last active December 19, 2015 01:38
Show Gist options
  • Save robbestad/5876816 to your computer and use it in GitHub Desktop.
Save robbestad/5876816 to your computer and use it in GitHub Desktop.
Kode som dekrypterer utfordring 3 fra Sikkerhetsbloggens konkurranse på http://blogg.nsm.stat.no/archives/3775
<?php
# Utf 3 - Sikkerhetsbloggen
# Sven A Robbestad 24 jun 2013
# http://blogg.nsm.stat.no/archives/3775
# Dekrypter følgende:
# 32 19 1C 12 1B 57 2F 38 25 57 04 18 1A 57 13 12
# 03 03 12 57 12 05 57 18 11 03 12 57 15 05 02 1C
# 03 57 16 01 57 1A 16 1B 00 16 05 12 59 57 3C 16
# 19 04 1C 1D 12 57 13 02 57 12 05 57 1E 19 03 12
# 05 12 04 04 12 05 03 57 1E 57 16 19 16 1B 0E 04
# 12 57 16 01 57 1A 16 1B 00 16 05 12 48
#
# Riktig verdi i $key gir svaret
$payload =array("32","19","1C","12","1B","57","2F","38","25","57","04","18","1A","57","13","12","03","03","12","57","12","05","57","18","11","03","12","57","15","05","02","1C","03","57","16","01","57","1A","16","1B","00","16","05","12","59","57","3C","16","19","04","1C","1D","12","57","13","02","57","12","05","57","1E","19","03","12","05","12","04","04","12","05","03","57","1E","57","16","19","16","1B","0E","04","12","57","16","01","57","1A","16","1B","00","16","05","12","48");
$key = "";
function hexstr($hex){
return chr(hexdec(substr($hex,0,2)));
}
foreach($payload as $v){
echo (hexstr($v) ^ hexstr($key));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment