[nSLUG] Crypt in Perl

Daniel Morrison draker at gmail.com
Wed Jan 7 22:36:43 AST 2009


2009/1/7 Daniel Morrison <draker at gmail.com>:

> Well, it could still be in libc also. If another language displays the
> same behaviour, it suggests it's in libc rather than the language.

PHP behaviour: same, but different!

$ php -r 'echo crypt("cow", "XX"),"\n";'
XXkTtHeIuQWzE
$ php -r 'echo crypt("cow", "X."),"\n";'
X.I4zfZAWwgt6
$ php -r 'echo crypt("cow", "X"),"\n";'
X$mnDAfXnw.9g
$ php -r 'echo crypt("cow", "YY"),"\n";'
YY8t72UucFxrI
$ php -r 'echo crypt("cow", "Y."),"\n";'
Y.OeKPSqbWjEY
$ php -r 'echo crypt("cow", "Y"),"\n";'
Y$mLA5ru//Loc


Result identical for all:

$ uname -smro / uname -smrp
Linux 2.6.22.6 i686 GNU/Linux
Linux 2.6.18-8.1.15.el5 x86_64 GNU/Linux
SunOS 5.10 sun4u sparc

$ php -v
PHP 5.2.6 (cli) (built: May  7 2008 15:39:30)
PHP 5.1.6 (cli) (built: Sep 20 2007 10:04:27)
PHP 5.0.2 (cli) (built: Oct 11 2004 01:38:48)



More information about the nSLUG mailing list