Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: クラック関数 (Crack) - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

crack_check" width="11" height="7"/> <variant_xor
Last updated: Thu, 31 May 2007

view this page in

XVI. クラック関数 (Crack)

導入

このモジュールの関数により、パスワードの '強度' を試すための CrackLib ライブラリが使用可能となります。パスワードの '強度' は、長さ、大文字/ 小文字の使用で確認され、指定した CrackLib の辞書を用いて確認されます。 CrackLib は、パスワードを '強化する' ために有用な統計情報も出力します。

注意: この拡張モジュールは » PECL レポジトリに移動 されており、以下のバージョン以降 PHP にバンドルされなくなっています。 PHP 5.0.0.

要件

CrackLib に関するより詳細な情報は、 » http://sourceforge.net/projects/cracklib にあります。

インストール手順

この » PECL 拡張 モジュールは PHP にバンドルされていません。 この PECL 拡張モジュールをインストールする方法は、 マニュアルの PECL 拡張モジュールのインストール という章にあります。 新規リリース・ダウンロード・ソースファイル・管理者情報・CHANGELOG といった関連する情報については、次の場所にあります。 » http://pecl.php.net/package/crack.

PHP 4 の場合、この PECL 拡張モジュール のソースは、PHP のソースの ext/ ディレクトリ、または 上の PECL リンクで入手可能です。 これらの関数を使用するためには、設定オプション --with-crack[=DIR] を用いて Crackサポートを有効にしてPHPを コンパイルする必要があります。

Windowsユーザは、これらの関数を使用するために、 php.ini の中に php_crack.dll を 追加します。 PHP 4 の場合、この DLL は PHP の Windows ダウンロードバイナリの extensions/ ディレクトリ にあります。 この PECL 拡張モジュール用の DLL は、» PHP のダウンロード ページあるいは » http://pecl4win.php.net/ からダウンロードできます。

実行時設定

php.ini の設定により動作が変化します。

表 38. Crack設定オプション

名前デフォルト変更可能変更履歴
crack.default_dictionaryNULLPHP_INI_PERDIRPHP 4.0.5 から利用可能です

PHP_INI_* 定数の詳細および定義については 付録 I. php.ini ディレクティブ を参照してください。

リソース型

CrackLib 拡張モジュールでは、crack_opendict() が返すディレクトリリソース識別子を定義しています。

定義済み定数

定数は定義されていません。

以下の例は、CrackLib 辞書をオープンする方法を示しており、 指定したパスワードを試験し、解析メッセージを取得し、辞書を閉じます。

例 406. CrackLib の例

<?php
// CrackLib 辞書をオープンする
$dictionary = crack_opendict('/usr/local/lib/pw_dict')
     or die(
'Unable to open CrackLib dictionary');

// パスワードチェックを行う
$check = crack_check($dictionary, 'gx9A2s0x');

// メッセージを取得する
$diag = crack_getlastmessage();
echo
$diag; // 'strong password'

// 辞書を閉じる
crack_closedict($dictionary);
?>

注意: crack_check()TRUE を返し、 crack_getlastmessage() は 'strong password' を返します。

目次

crack_check — 指定したパスワードに関して強度チェックを行う
crack_closedict — オープンされているCrackLib辞書を閉じる
crack_getlastmessage — 直近の強度チェックからのメッセージを返す
crack_opendict — 新規CrackLib辞書をオープンする


add a note add a note User Contributed Notes
クラック関数 (Crack)
Martin
06-Jun-2007 01:08
For those of you not familiar with the CrackLib Library:

CrackLib (or PHP Crack) can not cope with plaintext wordlists.
You have to generate a binary version of any plaintext list first.

After you have done this you get 3 files with different extensions:

my_list.txt

---->

my_list.pwd
my_list.hwm
my_list.pwi

crack_opendict() must be called with the first argument describing the path and base filename of the binary wordlist, e.g. C:\....\my_list or /usr/local/... (see below)

Now the bad news - how to generate the 3 files:

The only way i managed to do it:

o Download the CrackLib package from sourceforge (see link in php.net txt)
o USE UNIX/LINUX:
o run configure
o run make all
o run make install
o run make dict (having the wordlists in the /dict directory)
o look for the files in /usr/local/share/cracklib/
o copy the files in a convenient directory

That's it.

crack_check" width="11" height="7"/> <variant_xor
Last updated: Thu, 31 May 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites