<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'Courier New', courier, monaco, monospace, sans-serif;font-size:10pt"><div></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"></blockquote><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; ">> Take the 4 byte XOR key. If I convert them to int with Base 16<font class="Apple-style-span" face="'Courier New', courier, monaco, monospace, sans-serif" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></span><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; ">> it takes the 4 and converts it to 0x34 when I in turn I actually need 0x41. </span><div><font class="Apple-style-span" face="'times new roman', 'new york', times,
serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">OK, thats because int is for converting strings. You need to use struct.unpack</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">to convert the 4 bytes into an int.</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">You also need to figure out how many ints you have in your data
and </span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">construct a format string with that many ints to struct unpack the data.</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">Them apply the xor to each int using the key</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span"
style="font-size: 16px;">something like</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">key = struct.unpack("d", keydata)</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">num_ints = len(raw_data)/len(int)</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">data = struct.unpack("%dd" % num_ints, raw_data)</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span
class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">result = [n^key for n in data]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">(untested pseudo code!)</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size:
16px;">HTH,</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 16px;">Alan G. </span></font></div><div><div style="position:fixed"></div></div></div></body></html>