Php-crypt-md5

A pure PHP implementation of an MD5-hashsum-based implementation of the crypt routine, which can be used to generate hashs for Apache's passwd files.

Download .zip Download .tar.gz View on GitHub

PHP crypt-md5

A pure PHP implementation of an MD5-hashsum-based implementation of the crypt routine, which can be used to generate hashs for Apache's passwd files.

Build Status

Description

unix_md5_crypt() provides a crypt()-compatible interface to the rather new MD5-based crypt() function found in modern operating systems. It's based on the implementation found on FreeBSD 2.2.[56]-RELEASE and contains the following license in it:

"THE BEER-WARE LICENSE" (Revision 42):
<phk@login.dknet.dk> wrote this file.  As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp

apache_md5_crypt() provides a function compatible with Apache's .htpasswd files. This was contributed by Bryan Hart bryan@eai.com.

Usage

$cryptedpassword = Md5Crypt::unix   ($password [, $salt [, $magicstring ]);
$apachepassword  = Md5Crypt::apache ($password [, $salt]);

Authors

Other implementations this one is based on: