PaulDotCom mailing list archives

OpenLDAP userPassword field


From: DPorcello at vermontmutual.com (David Porcello)
Date: Wed, 9 Jun 2010 21:04:23 -0400

Hi all,

Does anyone know of a way to decode OpenLDAP's non-salted userPassword values from this:
{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

To this? (the underlying SHA hash):
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8

I know it needs to be base64 decoded to hex bytes, but I can't figure out how to do this without base64 decoding to 
ASCII first, then converting that to hex:

echo -n W6ph5Mm5Pz8GgiULbPgzG37mj9g= |base64 -d - |hexdump -e '/1 "%x" '

The problem with decoding to ASCII first is some of the output is control chars, such as line breaks, which hexdump 
isn't handling properly:

What I'm hoping for:
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8

What hexdump is giving me:
5baa61e4c9b93f*  68225 b6cf8331b7ee68fd8

As you can see parts of the hash are lost in translation. I've been working on this for weeks and I'm out of ideas 
(short of learning Java/C). I found an online converter that can do this properly 
(http://home1.paulschou.net/tools/xlate/), but I need to decode 10,000+ values..

Help!!
d.

NOTICE: The information contained in this e-mail and any attachments is intended solely for the recipient(s) named 
above, and may be confidential and legally privileged. If you received this e-mail in error, please notify the sender 
immediately by return e-mail and delete the original message and any copy of it from your computer system. If you are 
not the intended recipient, you are hereby notified that any review, disclosure, retransmission, dissemination, 
distribution, copying, or other use of this e-mail, or any of its contents, is strictly prohibited.

Although this e-mail and any attachments are believed to be free of any virus or other defects, it is the 
responsibility of the recipient to ensure that it is virus-free and no responsibility is accepted by the sender for any 
loss or damage arising if such a virus or defect exists.


Current thread: