Thank you all very much for these informative examples! I will try several things, and see what works best in my case. I am trying to write a simple RADIUS client. RADIUS client needs to XOR an MD5 digest with user's password (arbitrary length).