[PHP-users 4346] Re: linuxアカウントを認証したい

takaesu php-users@php.gr.jp
Wed, 19 Dec 2001 09:04:17 +0900


たかえすです。

On Tue, 18 Dec 2001 15:48:57 +0900 (JST)
HIGASHI Taku <oolong@cslab.co.jp> wrote:
> オンラインマニュアル http://www.php.net/manual/ja/function.crypt.php
> の User Contribute Notesの先頭に以下の記述があります。
> 
> crypt() on operating systems where multiple encryption mechanisms are
> supported gets triggered by the actual salt you feed it. If you feed crypt
> a 2-char salt, then it will use DES encryption. If you feed it a 12-char
> salt starting with $1$ it will use MD5. If you feed it a 17-char salt
> starting with $2$ it will do Blowfish.
> 
> というわけで、saltを12文字にすれば、うまく行きます。

うまく行きました。ありがとうございます。
ところで、私の環境では crypt()関数の値が /etc/shadow とマッチしたの
ですが md5()関数はどういう時に使うのでしょうか?
OSによって使い分けるのでしょうか。だとしたら DES or MD5 を判断する
にはどうしたらよいのでしょうか?

度々の質問、よろしくお願いします。

-- 
takaesu <takaesu@geocities.co.jp>