new crypt implementation, latest DES version used, blowfish support

[email protected] ("Pierre Joye")
Newsgroups php.internals.win
Message-ID <[email protected]>
Hi,

Please find in the links ([1] and [2]) below an updated version of the
crypt rewrite and fix (#45430).

The changes are:

- Use of the latest DES implementation ported to windows (using
CriticalSection for the locking)
- Blowfish support with salt generation (could be used for non windows
build as well)
- moved all the crypt code to win32/crypt
- added COPYING info about the licenses of the various algorithms (no
new weird licenses introduced)

Please test it, I like to fix the last possible issues before a commit :)


Some tests (from the manual but the blowfish without salt):
if (CRYPT_STD_DES == 1) {
    echo 'Standard DES: ' . crypt('rasmuslerdorf', 'rl') . "\n";
}

if (CRYPT_EXT_DES == 1) {
    echo 'Extended DES: ' . crypt('rasmuslerdorf', '_J9..rasm') . "\n";
}

if (CRYPT_MD5 == 1) {
    echo 'MD5:          ' . crypt('rasmuslerdorf', '$1$rasmusle$') . "\n";
}

if (CRYPT_BLOWFISH == 1) {
    echo 'BLOWFISH:     ' . crypt('rasmuslerdorf',
'$2a$07$rasmuslerd...........$') . "\n";
    echo 'BLOWFISH:     ' . crypt('rasmuslerdorf') . "\n"; /* Test
without salt */
}


[1] http://pierre.libgd.org/patches/php_5_3_crypt_win32.patch.txt
[2] http://pierre.libgd.org/patches/crypt20080720.zip

--
Pierre
http://blog.thepimp.net | http://www.libgd.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.