iconv and md5sum

I’d like to port the following script (source: [tt]http://www.wehavemorefun.de/fritzbox/index.php/Anrufliste_von_der_Box_holen[/tt]) to Vera V1 and Vera V2:

#!/bin/sh

# Challenge abholen
ChallengeXML=`wget -O - "http://fritz.box/cgi-bin/webcm?getpage=../html/login_sid.xml" 2>/dev/null| grep Challenge`
Challenge=`echo $ChallengeXML | awk '{match($0,/>[^<>]+</); print substr($0,RSTART+1,RLENGTH-2)}'`

Passwd="xxxxx"

# login aufbauen und hashen
CPSTR="$Challenge-$Passwd"
MD5=`echo -n $CPSTR | iconv -f ISO8859-1 -t UTF-16LE | md5sum -b | awk '{print substr($0,1,32)}'`
RESPONSE="$Challenge-$MD5"
POSTDATA="login:command/response=$RESPONSE&getpage=../html/de/menus/menu2.html"

# login senden und SID herausfischen
SID=`wget -O - --post-data="$POSTDATA" "http://fritz.box/cgi-bin/webcm" 2>/dev/null| grep "name=\"sid\"" | head -1 | awk '{match($0,/value="[^"]+"/); print substr($0,RSTART+7,RLENGTH-8)}'`

# refresh der daten auslösen
wget -O /dev/null "http://fritz.box//cgi-bin/webcm?sid=$SID&getpage=..%2Fhtml%2Fde%2Fmenus%2Fmenu2.html&errorpage=..%2Fhtml%2Fde%2Fmenus%2Fmenu2.html&var%3Apagename=foncalls&var%3Aerrorpagename=foncalls&var%3Amenu=home&var%3Apagemaster=&var%3Aactivtype=pppoe&var%3AtabInetstat=0&var%3Aweckernr=&logger%3Asettings%2Ffilter=2"

# CSV runterladen
wget -O ../fb_anrufliste.csv "http://fritz.box/cgi-bin/webcm?sid=$SID&getpage=..%2Fhtml%2Fde%2FFRITZ%21Box_Anrufliste.csv" 2>/dev/null

[tt]wget[/tt] doesn’t support [tt]–post-data[/tt], but could be replaced with [tt]curl[/tt].

Porting should be straightforward with two exceptions:

[ul][li][tt]md5sum[/tt] doesn’t support binary mode.[/li]
[li][tt]iconv[/tt] isn’t available.[/li][/ul]

Is there an easy way to work around the exceptions?

Looking at manpages of md5sum I think it may just work without the -b option.