Thanks all for great examples. I am trying to write a RADIUS client. It needs to XOR an MD5 digest (128 bit binary) with an arbitrary long user password. I'll try a few things, and see what works better. Thanks.