[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crypt



On Thu Dec 21, 2000 at 09:42:30AM -0800, Taheri, Babak wrote:
> I would like to know what is the equivalent command for the UNIX crypt
> command in Debian X86 Linux?

In Debian there is no crypt command.  There is a crypt(3) libc 
interface though.  If you want to crypt something, you can use 
perl to do this in a non-platform specific way:
    
    $ PASSWORD=foo perl -e 'srand ; @salt=(a..z,A..Z,0..9); \
	print crypt($ENV{PASSWORD}, $salt[rand(62)].$salt[rand(62)]), "\n";'
    o0naQJuvFx4UA

or if you want md5crypted passwords

    $ PASSWORD=foo perl -e 'srand ; @salt=(a..z,A..Z,0..9); \
	print crypt($ENV{PASSWORD}, "\$1\$".$salt[rand(62)].$salt[rand(62)]), "\n";'
    $1$Kp$rBBvl5cuAeJjJ6U1hCqpU1

Regards,

 -Erik
p.s. What does this have to do with debian-boot?

--
Erik B. Andersen   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--



Reply to: