Calculating a cryptographic MD5 hash


(Tim Bates) #1

Hi folks,
I want to generate an MD5 hash of a password in the same format as is
written to /etc/shadow. All the MD5-related libraries I can find
(including the one in the standard distribution) are aimed at doing MD5
checksums of strings or files, which isn’t what I want. Can someone
suggest how to do what I want (either by using a library I haven’t
discovered yet or adapting the MD5 checksum to do it)?

Tim.

···


Tim Bates
tim@bates.id.au


(Ceri Storey) #2

As far as I can see, you have two options. You can either port re-write
the algorithm (to be found here[0]) in ruby using Digest::MD5.
Alternatively, you could create a small C wrapper around the existing
implemenation.

···

On Sun, Feb 22, 2004 at 11:22:27AM +0900, Tim Bates wrote:

Hi folks,
I want to generate an MD5 hash of a password in the same format as is
written to /etc/shadow.


Ceri Storey cez@necrofish.org.uk