Reading and manipulating binary data
Christos TZOTZIOY Georgiou
tzot at sil-tec.gr
Sat Aug 30 12:42:18 EDT 2003
On Sat, 30 Aug 2003 19:50:33 +0400, rumours say that "Dave"
<davbucko at yahoo.com> might have written:
>Also part of the authentication system involves MD5 hashes. For this I need
>to be able to take a string, find its MD5 digest, and then xor it with
>another string. But since the MD5 digest is binary, and I don't know how to
>change it, I can't xor it... Please, I am sure I am missing something
>really obvious but I am stumped as to what it is.
A quick hint: a MD5 checksum is 16 bytes long; so if your machine has 32
bit integers, you can have a tuple of 4 ints with:
struct.unpack("4i", md5sum)
which you can use for xoring.
--
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.
More information about the Python-list
mailing list