[lug] portable md5 function?

Alan Robertson alanr at unix.sh
Tue Aug 21 17:54:19 MDT 2001


Alan Robertson wrote:
> 
> "D. Stimits" wrote:
> >
> > I'm trying to find out if there is now a semi-portable (at least among
> > linux machines, probably UNIX in general) md5 sum function call
> > available. The original crypt() one-way hash does not use md5, but most
> > of the linux distro's now use md5 (or make it available) for passwords.
> > Is this possibly built into the libpam library? I'm trying to find a C
> > function call to do this, without invoking a "system()" call.
> 
> Try this one.  It works for me ;-)
> 
> http://cvs.linux-ha.org/viewcvs/viewcvs.cgi/~checkout~/linux-ha/lib/plugins/HBauth/md5.c?rev=1.1&content-type=text/plain
> 
> Sorry for the funky URL, but that's viewcvs for ya.
> 
> There's also a crc and an md5 algorithm in the same directory:
> 
> http://cvs.linux-ha.org/viewcvs/viewcvs.cgi/linux-ha/lib/plugins/HBauth/#dirlist
> 
> It's got some boilerplate for a plugin loading system that we use, but it's
> easy to see what to call for the MD5 function if you want.

Or you can drag down the whole plugin loading system (*can you spell
overkill*? ;-)) and then authenticate with any type of authentication
function you want.  If you write any more that use the same form, let me
know and we'll put them up on our CVS instance ;-)

	-- Alan Robertson
	   alanr at unix.sh



More information about the LUG mailing list