Date: 08/12/00
- Next message: Rui Hirokawa: "[PHP-DOC] cvs: phpdoc /ja chapters.ent"
- Previous message: Rasmus Lerdorf: "[PHP-DOC] Hungarian manual is online"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hirokawa Fri Aug 11 21:15:43 2000 EDT
Added files:
/phpdoc/ja/functions ccvs.xml
Modified files:
/phpdoc/ja/functions array.xml cpdf.xml filesystem.xml gettext.xml
http.xml mcrypt.xml network.xml oci8.xml
strings.xml var.xml
Log:
added ccvs.xml and some functions in mcrypt and some bug-fixes.
Index: phpdoc/ja/functions/array.xml
diff -u phpdoc/ja/functions/array.xml:1.8 phpdoc/ja/functions/array.xml:1.9
--- phpdoc/ja/functions/array.xml:1.8 Thu Aug 10 09:29:03 2000
+++ phpdoc/ja/functions/array.xml Fri Aug 11 21:15:42 2000
@@ -1356,7 +1356,7 @@
</para>
<para>
<function>each</function>を実行した後、配列カーソルは、
- 配列の次の要素に移動しす。配列の最終要素にカーソルがある場合は、
+ 配列の次の要素に移動し~す。配列の最終要素にカーソルがある場合は、
最終要素にとどまります。
</para>
<para>
@@ -2047,17 +2047,6 @@
です。
</para>
<para>
- ソートの順番を指定するフラグ:
- <itemizedlist>
- <listitem>
- <simpara>SORT_ASC - 昇順のソート</simpara>
- </listitem>
- <listitem>
- <simpara>SORT_DESC - 降順のソート</simpara>
- </listitem>
- </itemizedlist>
- </para>
- <para>
ソート型のフラグ:
<itemizedlist>
<listitem>
@@ -2142,12 +2131,15 @@
<example>
<title><function>uksort</function>の例</title>
<programlisting role="php">
-function mycompare ($a, $b) {
+function cmp ($a, $b) {
if ($a == $b) return 0;
return ($a > $b) ? -1 : 1;
}
+
$a = array (4 => "four", 3 => "three", 20 => "twenty", 10 => "ten");
-uksort ($a, mycompare);
+
+uksort ($a, "cmp");
+
while (list ($key, $value) = each ($a)) {
echo "$key: $value\n";
}
@@ -2203,27 +2195,74 @@
if ($a == $b) return 0;
return ($a > $b) ? -1 : 1;
}
+
$a = array (3, 2, 5, 6, 1);
-usort ($a, cmp);
+
+usort ($a, "cmp");
+
while (list ($key, $value) = each ($a)) {
echo "$key: $value\n";
}
</programlisting>
</example>
+ </para>
+ <para>
この例は以下を表示します:
- <computeroutput>
+ </para>
+ <para>
+ <informalexample>
+ <programlisting>
0: 6
1: 5
2: 3
3: 2
4: 1
- </computeroutput>
- <note>
- <para>
- もちろん、このような簡単な例では<function>rsort</function>関数
- の方がより適しています。
- </para>
- </note>
+ </programlisting>
+ </informalexample>
+ </para>
+ <note>
+ <para>
+ もちろん、このような簡単な例では<function>rsort</function>関数
+ の方がより適しています。
+ </para>
+ </note>
+ <para>
+ <example>
+ <title>多次元配列を使用する<function>usort</function>の例</title>
+ <programlisting role="php">
+function cmp ($a, $b) {
+ return strcmp($a["fruit"],$b["fruit"]);
+}
+
+$fruits[0]["fruit"] = "lemons";
+$fruits[1]["fruit"] = "apples";
+$fruits[2]["fruit"] = "grapes";
+
+usort($fruits, "cmp");
+
+while (list ($key, $value) = each ($fruits)) {
+ echo "\$fruits[$key]: " . $value["fruit"] . "\n";
+}
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ 多次元配列をソートする際には、$a と $b は配列の最初のインデックス
+ への参照を保持しています。
+ </para>
+ <para>
+ この例の出力は以下となります。
+ </para>
+ <para>
+ <informalexample>
+ <programlisting>
+$fruits[0]: apples
+$fruits[1]: grapes
+$fruits[2]: lemons
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
<warning>
<para>
(Solarisシステムのような)いくつかのCライブラリに含まれる
Index: phpdoc/ja/functions/cpdf.xml
diff -u phpdoc/ja/functions/cpdf.xml:1.6 phpdoc/ja/functions/cpdf.xml:1.7
--- phpdoc/ja/functions/cpdf.xml:1.6 Sat Jul 15 08:12:13 2000
+++ phpdoc/ja/functions/cpdf.xml Fri Aug 11 21:15:42 2000
@@ -69,9 +69,11 @@
$cpdf = cpdf_open(0);
cpdf_page_init($cpdf, 1, 0, 595, 842);
cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
+cpdf_begin_text($pdf);
cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
cpdf_set_text_rendering($cpdf, 1);
cpdf_text($cpdf, "Times Roman outlined", 50, 750);
+cpdf_end_text($pdf);
cpdf_moveto($cpdf, 50, 740);
cpdf_lineto($cpdf, 330, 740);
cpdf_stroke($cpdf);
Index: phpdoc/ja/functions/filesystem.xml
diff -u phpdoc/ja/functions/filesystem.xml:1.12 phpdoc/ja/functions/filesystem.xml:1.13
--- phpdoc/ja/functions/filesystem.xml:1.12 Wed Aug 2 16:21:09 2000
+++ phpdoc/ja/functions/filesystem.xml Fri Aug 11 21:15:42 2000
@@ -970,7 +970,7 @@
<simpara>
ロック中に <function>flock</function>でブロックを行いたくない場
合は、<parameter>operation</parameter> に LOCK_NB ( PHP 4.0.1
- よ以前の場合は 4 に設定します)を加えます。
+ よۥ前の場合は 4 に設定します)を加えます。
</simpara>
</listitem>
</itemizedlist>
@@ -1235,9 +1235,65 @@
<function>fwrite</function>, <function>fopen</function>,
<function>fsockopen</function>, <function>popen</function>,
<function>fgets</function>, <function>fgetss</function>,
+ <function>fscanf</function>,
<function>file</function>, <function>fpassthru</function>
も参照下さい。
</simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.fscanf">
+ <refnamediv>
+ <refname>fscanf</refname>
+ <refpurpose>フォーマットに基づきファイルからの入力を処理する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>mixed <function>fscanf</function></funcdef>
+ <paramdef>int <parameter>handle</parameter></paramdef>
+ <paramdef>string <parameter>format</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>var1</optional></parameter>...
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 関数<function>fscanf</function> は <function>sscanf</function> に
+ 似ていますが、<parameter>handle</parameter>が指すファイルから入力
+ を取得し、指定したフォーマット <parameter>format</parameter>に基
+ づき解釈を行います。この関数のパラメータが二つだけの場合、処理さ
+ れた値は配列として返されます。他方、オプションのパラメータが指定
+ された場合、この関数は、代入された値の数を返します。オプション引
+ 数は参照渡しとする必要があります。
+ <example>
+ <title><function>fscanf</function> の例</title>
+ <programlisting role="php">
+$fp = fopen("users.txt","r");
+while ($userinfo = fscanf($fp,"%s\t%s\t%s\n")) {
+ list($name, $profession, $countrycode) = $userinfo;
+ //... 値を用いた処理
+}
+fclose($fp);
+ </programlisting>
+ </example>
+ <example>
+ <title>users.txt</title>
+ <programlisting>
+javier argonaut pe
+hiroshi sculptor jp
+robert slacker us
+luigi florist it
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ <function>fread</function>,
+ <function>fgets</function>, <function>fgetss</function>,
+ <function>sscanf</function>, <function>printf</function>,
+ <function>sprintf</function> も参照下さい。
+ </para>
</refsect1>
</refentry>
Index: phpdoc/ja/functions/gettext.xml
diff -u phpdoc/ja/functions/gettext.xml:1.2 phpdoc/ja/functions/gettext.xml:1.3
--- phpdoc/ja/functions/gettext.xml:1.2 Sat Jun 24 00:38:44 2000
+++ phpdoc/ja/functions/gettext.xml Fri Aug 11 21:15:42 2000
@@ -2,6 +2,14 @@
<title>GNU Gettext</title>
<titleabbrev>gettext</titleabbrev>
+ <partintro>
+ <simpara>
+ gettext 関数は、NLS (Native Language Support) APIを実装するもので、
+ PHPアプリケーションを国際化する際に使用することが可能です。
+ これらの関数の詳細については、GNU gettext ドキュメントを参照下さい。
+ </simpara>
+ </partintro>
+
<refentry id="function.bindtextdomain">
<refnamediv>
<refname>bindtextdomain</refname>
Index: phpdoc/ja/functions/http.xml
diff -u phpdoc/ja/functions/http.xml:1.5 phpdoc/ja/functions/http.xml:1.6
--- phpdoc/ja/functions/http.xml:1.5 Sat Jul 1 10:21:10 2000
+++ phpdoc/ja/functions/http.xml Fri Aug 11 21:15:42 2000
@@ -75,6 +75,32 @@
</programlisting>
</informalexample>
</para>
+ <para>
+ <function>headers_sent</function>も参照下さい。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.headers-sent">
+ <refnamediv>
+ <refname>header_sent</refname>
+ <refpurpose>ヘッダーが送信されている場合に true を返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>boolean <function>headers_sent</function></funcdef>
+ <paramdef><parameter>void</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ この関数は、HTTPヘッダが既に送信されている場合に true 、そうでな
+ い場合に false を返します。
+ </para>
+ <para>
+ <function>header</function>も参照下さい。
+ </para>
</refsect1>
</refentry>
Index: phpdoc/ja/functions/mcrypt.xml
diff -u phpdoc/ja/functions/mcrypt.xml:1.4 phpdoc/ja/functions/mcrypt.xml:1.5
--- phpdoc/ja/functions/mcrypt.xml:1.4 Sun Jun 25 06:25:53 2000
+++ phpdoc/ja/functions/mcrypt.xml Fri Aug 11 21:15:42 2000
@@ -16,20 +16,27 @@
加えて、"フリーではない" と思われるRC6 および IDEA もサポートします。
</para>
<para>
- これを使用するには、<ulink url="&url.mcrypt;">ここ</ulink> から
+ libmcrypt 2.4.xとリンクした場合、加えてブロックアルゴリズム:
+ CAST, LOKI97, RIJNDAEL, SAFERPLUS, SERPENT および次のストリーム暗
+ 号: ENIGMA (crypt), PANAMA, RC4 ,WAKE がサポートされます。
+ libmcrypt 2.4.x を使用した場合、暗号モード nOFB もサポートされます。
+ </para>
+ <para>
+ この拡張機能を使用するには、<ulink url="&url.mcrypt;">ここ</ulink> から
libmcrypt-x.x.tar.gz をダウンロードし、含まれているインストール用の
指示に従って下さい。この拡張機能を利用可能にするためには、
PHP を <option role="configure">--with-mcrypt</option> パラメータを
- 付けてコンパイルする必要があります。
+ 付けてコンパイルする必要があります。必ず、
+ <option role="configure">--disable-posix-threads</option>を付けて
+ libmcrypt をコンパイルして下さい。
</para>
<para>
mcrypt は、上に示した暗号を用いて暗号化および複合化を
- 行うことが可能です。4つの重要な mcrypt コマンド
- (<function>mcrypt_cfb</function>, <function>mcrypt_cbc</function>,
- <function>mcrypt_ecb</function>,
- <function>mcrypt_ofb</function>) は、
- MCRYPT_ENCRYPT および MCRYPT_DECRYPT という
- 2つのモードの両方で実行可能です。
+ 行うことが可能です。libmcrypt-2.2.xとリンクした場合、4つの重要な
+ mcrypt コマンド (<function>mcrypt_cfb</function>,
+ <function>mcrypt_cbc</function>,<function>mcrypt_ecb</function>,
+ <function>mcrypt_ofb</function>) は、MCRYPT_ENCRYPT および
+ MCRYPT_DECRYPT という 2つのモードの両方で実行可能です。
<example>
<title>入力値を ECB モードの TripleDES で暗号化する</title>
<programlisting role="php">
@@ -45,11 +52,33 @@
返されます。
</para>
<para>
- mcryptは4つの暗号化モード(CBC, OFB, CFB, ECB)で実行可能です。
- ここで、これらの各モードの通常の使用法の概要を示します。
- 詳細なリファレンスおよび議論に関しては、
- &book.applied.cryptography; を参照下さい。
+ libmcrypt 2.4.x とリンクした場合、上記の関数も利用可能ですが、新し
+ い関数を使用されることを推奨します。
+ <example>
+ <title>ECBモードでTripleDESにより入力を暗号化する</title>
+ <programlisting role="php">
+<?php
+$key = "this is a very secret key";
+$input = "Let us meet at 9 o'clock at the secret place.";
+$td = mcrypt_open_module (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB);
+$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
+mcrypt_generic_init ($td, $key, $iv);
+$encrypted_data = mcrypt_generic ($td, $input);
+mcrypt_generic_end ($td);
+?>
+ </programlisting>
+ </example>
+ この例は、<literal>$encrypted_data</literal>に文字列として暗号化さ
+ れたデータを取得します。
+ </para>
+ <para>
+ mcryptは4つのブロック暗号モード(CBC, OFB, CFB, ECB)で実行可能です。
+ libmcrypt-2.4.xにリンクした場合、ブロック暗号モード nOFG とSTREAM
+ モードでも実行可能です。MCRYPT_MODE_mode 形式を関数で使用する際に
+ は、いくつかの制約があります。ここで、これらの各モードの通常の使用
+ 法の概要を示します。詳細なリファレンスおよび議論に関しては、
+ &book.applied.cryptography; を参照下さい。
<itemizedlist>
<listitem>
<simpara>
@@ -73,9 +102,23 @@
</simpara>
</listitem>
<listitem>
+ <simpara>
+ OFB (output feedback、8ビット形式) は CFB と互換性がありますが、
+ エラーの伝播が許容されないアプリケーションに使用することが可能
+ です。このモードは(8ビットモードで処理を行うため)安全ではなく、
+ 使用は推奨されません。
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ nOFB (output feedback, n ビット形式) はOFB と互換ですが、
+ アルゴリズムのブロックサイズを変更可能なため、より安全です。
+ </simpara>
+ </listitem>
+ <listitem>
<simpara>
- OFB (output feedback) は CFB と互換性がありますが、
- エラーの伝播が許容されないアプリケーションに使用することが可能です。
+ STREAM は、WAKE や RC4 のようないくつかのストリームアルゴリズム
+ を読み込む追加のモードです。
</simpara>
</listitem>
</itemizedlist>
@@ -86,34 +129,60 @@
</para>
<para>
サポートされる暗号の完全なリストについては、mcrypt.h の define を
- 参照下さい。
- 一般に、特定の暗号は、PHP で MCRYPT_暗号名 とすることによりアクセス
- 可能です。
+ 参照下さい。mcrypt-2.2.x API に関する一般的な規則は、MCRYPT_暗号名
+ でPHPから暗号をアクセス可能であるということです。mcrypt-2.4.x API
+ についてもこれらの規則は成り立ちますが、
+ <function>mcrypt_open_module</function> をコールする際に文字列で暗
+ 号名を指定することも可能です。
</para>
<para>
以下に現在 mcrypt 拡張機能においてサポートされている暗号の簡単なリストを
示します。mcrypt がサポートする暗号がこのリストにのっていない場合、
このドキュメントが古いと仮定して下さい。
-
<itemizedlist>
<listitem>
<simpara>
+ MCRYPT_ARCFOUR_IV (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_ARCFOUR (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
MCRYPT_BLOWFISH
</simpara>
</listitem>
<listitem>
<simpara>
+ MCRYPT_CAST_128
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_CAST_256
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_CRYPT
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
MCRYPT_DES
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_TripleDES
+ MCRYPT_DES_COMPAT (libmcrypt 2.2.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_ThreeWAY
+ MCRYPT_ENIGMA (libmcrypt 2.4.x のみ, MCRYPT_CRYPTへのエイリアス)
</simpara>
</listitem>
<listitem>
@@ -123,16 +192,71 @@
</listitem>
<listitem>
<simpara>
- MCRYPT_CRYPT
+ MCRYPT_IDEA (non-free)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_LOKI97 (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_MARS (libmcrypt 2.4.x のみ, non-free)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_PANAMA (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RIJNDAEL_128 (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RIJNDAEL_192 (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_DES_COMPAT
+ MCRYPT_RIJNDAEL_256 (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
+ MCRYPT_RC2
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RC4 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RC6 (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RC6_128 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RC6_192 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_RC6_256 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
MCRYPT_SAFER64
</simpara>
</listitem>
@@ -143,27 +267,58 @@
</listitem>
<listitem>
<simpara>
- MCRYPT_CAST128
+ MCRYPT_SAFERPLUS (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_TEAN
+ MCRYPT_SERPENT (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_RC2
+ MCRYPT_SERPENT_128 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_SERPENT_192 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_SERPENT_256 (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_SKIPJACK (libmcrypt 2.4.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_TEAN (libmcrypt 2.2.x のみ)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_THREEWAY
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ MCRYPT_TRIPLEDES
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_TWOFISH (古い mcrypt 2.x バージョン用)
+ MCRYPT_TWOFISH (以前のバージョン mcrypt 2.x または、mcrypt 2.4.x 用)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_TWOFISH128 (TWOFISHxxx は最近の 2.x バージョンで利用可能)
+ MCRYPT_TWOFISH128 (TWOFISHxxx は 2.x より新しいバージョンで利用
+ 可能ですが、2.4.x バージョンでは利用不可)
</simpara>
</listitem>
<listitem>
@@ -178,27 +333,25 @@
</listitem>
<listitem>
<simpara>
- MCRYPT_RC6
+ MCRYPT_WAKE (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
<listitem>
<simpara>
- MCRYPT_IDEA
+ MCRYPT_XTEA (libmcrypt 2.4.x のみ)
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
- CFB および OFBモードではそれぞれの暗号関数に初期化ベクトル(IV) を与える
- 必要があり、CBCモードではIVを指定することが可能です。
+ CFB および OFBモードでは、それぞれの暗号関数に初期化ベクトル(IV)
+ を指定する必要があり、CBCモードではIVを指定することが可能です。
IV は、ユニークである必要があり、暗号化/複合化の際に同じである
- 必要があります。
- 暗号化されて保存されたデータの場合、関数の出力を
+ 必要があります。暗号化されて保存されたデータの場合、関数の出力を
(ファイル名の MD5 キーのように) 保存されたデータの位置を表す
- インデックスとして使用することができます。
- もしくは、暗号化されたデータと共にIV を渡すことができます。
- (このトピックに関する議論については、&book.applied.cryptography; の 9.3 章
- を参照下さい)
+ インデックスとして使用することができます。もしくは、暗号化されたデー
+ タと共にIV を渡すことができます。(このトピックに関する議論について
+ は、&book.applied.cryptography; の 9.3 章を参照下さい)
</para>
</partintro>
@@ -215,13 +368,19 @@
<paramdef>int <parameter>cipher</parameter></paramdef>
</funcprototype>
</funcsynopsis>
-
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_get_cipher_name</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
<para>
<function>mcrypt_get_cipher_name</function> は、指定した暗号(cipher)
の名前を得るために使用されます。
</para>
<para>
- <function>mcrypt_get_cipher_name</function> は、暗号番号を引数とし、
+ <function>mcrypt_get_cipher_name</function> は、暗号の番号
+ (libmcrypt 2.2.x)または暗号名(libmcrypt 2.4.x)を引数とし、
暗号名を返します。指定した暗号が存在しない場合は、false を返します。
</para>
<para>
@@ -332,7 +491,7 @@
<para>
source には、MCRYPT_RAND (システムの乱数生成器),
MCRYPT_DEV_RANDOM (/dev/random からデータを読む) ,MCRYPT_DEV_URANDOM
- (/dev/urandom からデータを読む) を指定できます。
+ (/dev/urandom からータを読む) を指定できます。
MCRYPT_RAND を使用した場合、乱数生成器を初期化するために
必ず前もって srand() をコールして下さい。
</para>
@@ -369,8 +528,23 @@
<parameter><optional>iv</optional></parameter>
</paramdef>
</funcprototype>
+ </funcsynopsis>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_cbc</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>int <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>iv</optional></parameter>
+ </paramdef>
+ </funcprototype>
</funcsynopsis>
-
+ <para>
+ 最初のプロトタイプは、libmcrypt 2.2.x とリンクした場合、2番目は、
+ libmcrypt 2.4.x とリンクした場合です。
+ </para>
<para>
<function>mcrypt_cbc</function>は、CBC 暗号化モードで
<parameter>cipher</parameter>および<parameter>key</parameter>
@@ -421,6 +595,22 @@
<paramdef>string <parameter>iv</parameter></paramdef>
</funcprototype>
</funcsynopsis>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_cfb</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>int <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>iv</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 最初のプロトタイプは、libmcrypt 2.2.x とリンクした場合、2番目は、
+ libmcrypt 2.4.x とリンクした場合です。
+ </para>
<para>
<function>mcrypt_cfb</function> は、CFB 暗号化モードで
<parameter>cipher</parameter> および <parameter>key</parameter>
@@ -471,6 +661,22 @@
<paramdef>int <parameter>mode</parameter></paramdef>
</funcprototype>
</funcsynopsis>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_ecb</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>int <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>iv</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 最初のプロトタイプは、libmcrypt 2.2.x とリンクした場合、2番目は、
+ libmcrypt 2.4.x とリンクした場合です。
+ </para>
<para>
<function>mcrypt_ecb</function> は、ECB 暗号化モードで
<parameter>cipher</parameter> および <parameter>key</parameter>
@@ -521,9 +727,24 @@
<paramdef>int <parameter>mode</parameter></paramdef>
<paramdef>string <parameter>iv</parameter></paramdef>
</funcprototype>
+ </funcsynopsis>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_ofb</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>int <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>iv</optional></parameter>
+ </paramdef>
+ </funcprototype>
</funcsynopsis>
-
<para>
+ 最初のプロトタイプは、libmcrypt 2.2.x とリンクした場合、2番目は、
+ libmcrypt 2.4.x とリンクした場合です。
+ </para>
+ <para>
<function>mcrypt_ofb</function> は、OFB 暗号化モードで
<parameter>cipher</parameter> および <parameter>key</parameter>
を用いて
@@ -556,6 +777,842 @@
</refsect1>
</refentry>
+ <refentry id="function.mcrypt-list-algorithms">
+ <refnamediv>
+ <refname>mcrypt_list_algorithms</refname>
+ <refpurpose>サポートされる全ての暗号を配列として取得する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>mcrypt_list_algorithms</function></funcdef>
+ <paramdef>string
+ <parameter>
+ <optional>lib_dir</optional>
+ </parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>mcrypt_list_algorithms</function> は、
+ <parameter>lib_dir</parameter>にあるサポートされる暗号を全て取得
+ するために使用します。
+ </para>
+ <para>
+ <function>mcrypt_list_algorithms</function> はオプションのパラメー
+ タとして <parameter>lib_dir</parameter> をとり、全てのアルゴリズ
+ ムがある場所のディレクトリを指定することが可能です。指定されない
+ 場合には、php.iniディレクティブmcrypt.algorithms_dirの値が使用さ
+ れます。
+ </para>
+ <para>
+ <example>
+ <title><function>mcrypt_list_algorithms</function> の例</title>
+ <programlisting role="php">
+<?php
+$algorithms = mcrypt_list_algorithms ("/usr/local/lib/libmcrypt");
+
+foreach ($algorithms as $cipher) {
+ echo $cipher."/n";
+}
+?>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ 上記の例は、"/usr/local/lib/libmcrypt" ディレクトリにある全てのサ
+ ポートされるアルゴリズムの一覧を表示します。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-list-modes">
+ <refnamediv>
+ <refname>mcrypt_list_modes</refname>
+ <refpurpose>サポートされる全てのモードの配列を取得する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>mcrypt_list_modes</function></funcdef>
+ <paramdef>string
+ <parameter>
+ <optional>lib_dir</optional>
+ </parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>mcrypt_list_modes</function> は、
+ <parameter>lib_dir</parameter>にあるサポートされる全てのモードを
+ 取得するために使用されます。
+ </para>
+ <para>
+ <function>mcrypt_list_modes</function> はオプションのパラメータと
+ して全てのモードがある場所をとります。指定されない場合には、
+ php.ini ディレクティブのmcrypt.modes_dirの値が使用されます。
+ </para>
+ <para>
+ <example>
+ <title><function>mcrypt_list_modes</function> の例</title>
+ <programlisting role="php">
+<?php
+$modes = mcrypt_list_modes ();
+
+foreach ($modes as $mode) {
+ echo $mode."/n";
+}
+?>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ 上の例は、デフォルトのモードディレクトリにあるサポートされる全て
+ のアルゴリズムの一覧を出力します。ini ディレクティブの
+ mcrypt.modes_dir でこれが設定されていない場合、mcryptのデフォルト
+ ディレクトリ(/usr/local/lib/libmcrypt)が使用されます。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-get-iv-size">
+ <refnamediv>
+ <refname>mcrypt_get_iv_size</refname>
+ <refpurpose>
+ 指定した暗号/モードの組み合わせに属するIVの大きさを返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_get_iv_size</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>Mcrypt_get_iv_size</function> returns the size of
+ the Initialisation Vector (IV). On error the function returns
+ FALSE. If the IV is ignored in the specified cipher/mode
+ combination zero is returned.
+ </para>
+ <para>
+ <parameter>Cipher</parameter> is one of the MCRYPT_ciphername
+ constants of the name of the algorithm as string.
+ </para>
+ <para>
+ <parameter>Mode</parameter> is one of the MCRYPT_MODE_modename
+ constants of one of "ecb", "cbc", "cfb", "ofb", "nofb" or
+ "stream".
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-encrypt">
+ <refnamediv>
+ <refname>mcrypt_encrypt</refname>
+ <refpurpose>指定したパラメータでプレーンテキストを暗号化する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_encrypt</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter>
+ <optional>iv</optional>
+ </parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>Mcrypt_encrypt</function> encrypts the data
+ and returns the encrypted data.
+ </para>
+ <para>
+ <parameter>Cipher</parameter> is one of the MCRYPT_ciphername
+ constants of the name of the algorithm as string.
+ </para>
+ <para>
+ <parameter>Key</parameter> is the key with which the data
+ will be encrypted. If it's smaller that the required keysize, it
+ is padded with '\0'.
+ </para>
+ <para>
+ <parameter>Data</parameter> is the data that will be encrypted
+ with the given cipher and mode. If the size of the data is not
+ n * blocksize, the data will be padded with '\0'. The returned
+ crypttext can be larger that the size of the data that is given
+ by <parameter>data</parameter>.
+ </para>
+ <para>
+ <parameter>Mode</parameter> is one of the MCRYPT_MODE_modename
+ constants of one of "ecb", "cbc", "cfb", "ofb", "nofb" or
+ "stream".
+ </para>
+ <para>
+ The <parameter>IV</parameter> parameter is used for the
+ initialisation in CBC, CFB, OFB modes, and in some algorithms
+ in STREAM mode. If you do not supply an IV, while it is needed
+ for an algorithm, the function issues a warning and uses an
+ IV with all bytes set to '\0'.
+ </para>
+ <para>
+ <example>
+ <title><function>Mcrypt_encrypt</function> Example</title>
+ <programlisting role="php">
+<?php
+$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND);
+$key = "This is a very secret key";
+$text = "Meet me at 11 o'clock behind the monument.";
+echo strlen ($text)."\n";
+
+$crypttext = mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
+echo strlen ($crypttext)."\n";
+?>
+ </programlisting>
+ </example>
+ The above example will print out:
+ <programlisting>
+42
+64
+ </programlisting>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-decrypt">
+ <refnamediv>
+ <refname>mcrypt_decrypt</refname>
+ <refpurpose>指定したパラメータで暗号化されたテキストを複合する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_decrypt</function></funcdef>
+ <paramdef>string <parameter>cipher</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ <paramdef>string
+ <parameter>
+ <optional>iv</optional>
+ </parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>Mcrypt_decrypt</function> decrypts the data
+ and returns the unencrypted data.
+ </para>
+ <para>
+ <parameter>Cipher</parameter> is one of the MCRYPT_ciphername
+ constants of the name of the algorithm as string.
+ </para>
+ <para>
+ <parameter>Key</parameter> is the key with which the data
+ is encrypted. If it's smaller that the required keysize, it
+ is padded with '\0'.
+ </para>
+ <para>
+ <parameter>Data</parameter> is the data that will be decrypted
+ with the given cipher and mode. If the size of the data is not
+ n * blocksize, the data will be padded with '\0'.
+ </para>
+ <para>
+ <parameter>Mode</parameter> is one of the MCRYPT_MODE_modename
+ constants of one of "ecb", "cbc", "cfb", "ofb", "nofb" or
+ "stream".
+ </para>
+ <para>
+ The <parameter>IV</parameter> parameter is used for the
+ initialisation in CBC, CFB, OFB modes, and in some algorithms
+ in STREAM mode. If you do not supply an IV, while it is needed
+ for an algorithm, the function issues a warning and uses an
+ IV with all bytes set to '\0'.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-open">
+ <refnamediv>
+ <refname>mcrypt_module_open</refname>
+ <refpurpose>
+ 使用するアルゴリズムおよびモードのモジュールをオープンする
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>resource <function>mcrypt_module_open</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string <parameter>algorithm_directory</parameter></paramdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ <paramdef>string <parameter>mode_directory</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function opens the module of the algorithm and the mode
+ to be used. The name of the algorithm is specified in algorithm,
+ eg "twofish" or is one of the MCRYPT_ciphername constants.
+ The library is closed by calling
+ <function>mcrypt_module_close</function>, but there is no need
+ to call that function if <function>mcrypt_generic_end</function>
+ is called. Normally it returns an encryption descriptor, or
+ FALSE on error.
+ </para>
+ <para>
+ The <parameter>algorithm_directory</parameter> and
+ <parameter>mode_directory</parameter> are used to locate the
+ encryption modules. When you supply a directory name, it is used.
+ When you set one of these to the empty string (""), the value set
+ by the <parameter>mcrypt.algorithms_dir</parameter> or
+ <parameter>mcrypt.modes_dir</parameter> ini-directive is used.
+ When these are not set, the default directory are used that are
+ compiled in into libmcrypt (usally /usr/local/lib/libmcrypt).
+ </para>
+ <para>
+ <example>
+ <title><function>Mcrypt_module_open</function> Example</title>
+ <programlisting role="php">
+<?php
+$td = mcrypt_module_open (MCRYPT_DES, "", MCRYPT_MODE_ECB, "/usr/lib/mcrypt-modes");
+?>
+ </programlisting>
+ </example>
+ The above example will try to open the DES cipher from the default
+ directory and the EBC mode from the directory /usr/lib/mcrypt-modes.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-generic-init">
+ <refnamediv>
+ <refname>mcrypt_generic_init</refname>
+ <refpurpose>暗号化に必要な全てのバッファを初期化する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_generic_init</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ <paramdef>string <parameter>key</parameter></paramdef>
+ <paramdef>string <parameter>iv</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ The maximum length of the key should be the one obtained by
+ calling <function>mcrypt_enc_get_key_size</function> and every
+ value smaller than this is legal. The IV should normally have
+ the size of the algorithms block size, but you must obtain the
+ size by calling <function>mcrypt_enc_get_iv_size</function>.
+ IV is ignored in ECB. IV MUST exist in CFB, CBC, STREAM, nOFB
+ and OFB modes. It needs to be random and unique (but not secret).
+ The same IV must be used for encryption/decryption. If you do not
+ want to use it you should set it to zeros, but this is not
+ recommended. The function returns (-1) on error.
+ </para>
+ <para>
+ You need to call this function before every
+ <function>mcrypt_generic</function> or
+ <function>mdecrypt_generic</function>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-generic">
+ <refnamediv>
+ <refname>mcrypt_generic</refname>
+ <refpurpose>データを暗号化する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_generic</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function encrypts data. The data is padded with "\0"
+ to make sure the length of the data is n * blocksize. This
+ function returns the encrypted data. Note that the length
+ of the returned string can in fact be longer then the input,
+ due to the padding of the data.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mdecrypt-generic">
+ <refnamediv>
+ <refname>mdecrypt_generic</refname>
+ <refpurpose>データを複合する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mdecrypt_generic</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ <paramdef>string <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function decrypts data. Note that the length of the
+ returned string can in fact be longer then the unencrypted
+ string, due to the padding of the data.
+ </para>
+ <para>
+ <example>
+ <title><function>Mdecrypt_generic</function> Example</title>
+ <programlisting role="php">
+<?php
+$iv_size = mcrypt_enc_get_iv_size ($td));
+$iv = <email protected> ($iv_size, MCRYPT_RAND);
+
+if ( <email protected> ($td, $key, $iv) != -1)
+{
+ $c_t = mcrypt_generic ($td, $plain_text);
+ <email protected> ($td, $key, $iv);
+ $p_t = mdecrypt_generic ($td, $c_t);
+}
+if (strncmp ($p_t, $plain_text, strlen($plain_text)) == 0)
+ echo "ok";
+else
+ echo "error";
+?>
+ </programlisting>
+ </example>
+ The above example shows how to check if the data before the
+ encryption is the same as the data after the decryption.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-generic-end">
+ <refnamediv>
+ <refname>mcrypt_generic_end</refname>
+ <refpurpose>暗号処理を終了する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>mcrypt_generic_end</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function terminates encryption specified by the encryption
+ descriptor (td). Actually it clears all buffers, and closes
+ all the modules used. Returns FALSE on error, or TRUE on succes.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-self-test">
+ <refnamediv>
+ <refname>mcrypt_enc_self_test</refname>
+ <refpurpose>オープンしたモジュールのセルフテストを実行する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_self_test</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function runs the self test on the algorithm specified by the
+ descriptor td. If the self test succeeds it returns zero. In case
+ of an error, it returns 1.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-is-block-algorithm-mode">
+ <refnamediv>
+ <refname>mcrypt_enc_is_block_algorithm_mode</refname>
+ <refpurpose>
+ オープンされたモードの暗号がブロックモードで動作するかどうかを調べる
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_is_block_algorithm_mode</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns 1 if the mode is for use with block algorithms,
+ otherwise it returns 0. (eg. 0 for stream, and 1 for cbc, cfb, ofb).
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-is-block-algorithm">
+ <refnamediv>
+ <refname>mcrypt_enc_is_block_algorithm</refname>
+ <refpurpose>
+ オープンされたモードの暗号がブロックモードであるかどうかを調べる
+ algorithm
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_is_block_algorithm</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns 1 if the algorithm is a block algorithm,
+ or 0 if it is a stream algorithm.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-is-block-mode">
+ <refnamediv>
+ <refname>mcrypt_enc_is_block_mode</refname>
+ <refpurpose>
+ オープンされたモードがブロック出力を行うかどうかを調べる
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_is_block_mode</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns 1 if the mode outputs blocks of bytes or
+ 0 if it outputs bytes. (eg. 1 for cbc and ecb, and 0 for cfb and
+ stream).
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-block-size">
+ <refnamediv>
+ <refname>mcrypt_enc_get_block_size</refname>
+ <refpurpose>オープンされたアルゴリズムのブロックサイズを返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_get_block_size</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the block size of the algorithm specified by
+ the encryption descriptor td in bytes.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-key-size">
+ <refnamediv>
+ <refname>mcrypt_enc_get_key_size</refname>
+ <refpurpose>
+ オープンされたモードでサポートされる最大キー長を返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_get_key_size</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the maximum supported key size of the
+ algorithm specified by the encryption descriptor td in bytes.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-supported-key-sizes">
+ <refnamediv>
+ <refname>mcrypt_enc_get_supported_key_sizes</refname>
+ <refpurpose>
+ オープンされたアルゴリズムでサポートされるキー長を配列で返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>mcrypt_enc_get_supported_key_sizes</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Returns an array with the key sizes supported by the algorithm
+ specified by the encryption descriptor. If it returns an empty
+ array then all key sizes between 1 and
+ <function>mcrypt_enc_get_key_size</function> are supported by the
+ algorithm.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-iv-size">
+ <refnamediv>
+ <refname>mcrypt_enc_get_iv_size</refname>
+ <refpurpose>オープンされたアルゴリズムのIVの大きさを返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_enc_get_iv_size</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the size of the iv of the algorithm
+ specified by the encryption descriptor in bytes. If it returns
+ '0' then the IV is ignored in the algorithm. An IV is used in
+ cbc, cfb and ofb modes, and in some algorithms in stream mode.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-algorithms-name">
+ <refnamediv>
+ <refname>mcrypt_enc_get_algorithms_name</refname>
+ <refpurpose>オープンされたアルゴリズムの名前を返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_enc_get_algorithms_name</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the name of the algorithm.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-enc-get-modes-name">
+ <refnamediv>
+ <refname>mcrypt_enc_get_modes_name</refname>
+ <refpurpose>オープンされたモードの名前を返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>mcrypt_enc_get_modes_name</function></funcdef>
+ <paramdef>resource <parameter>td</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the name of the mode.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-self-test">
+ <refnamediv>
+ <refname>mcrypt_module_self_test</refname>
+ <refpurpose>指定したモジュールのセルフテストを実行する</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>mcrypt_module_self_test</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function runs the self test on the algorithm specified.
+ The optional <parameter>lib_dir</parameter> parameter can contain
+ the location of where the algorithm module is on the system.
+ </para>
+ <para>
+ The function returns TRUE if the self test succeeds, or FALSE when
+ if fails.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-is-block-algorithm-mode">
+ <refnamediv>
+ <refname>mcrypt_module_is_block_algorithm_mode</refname>
+ <refpurpose>
+ 指定したモジュールがブロックアルゴリズムであるかどうかを返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>mcrypt_module_is_block_algorithm_mode</function></funcdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns TRUE if the mode is for use with block algorithms,
+ otherwise it returns 0. (eg. 0 for stream, and 1 for cbc, cfb, ofb).
+ The optional <parameter>lib_dir</parameter> parameter can contain
+ the location where the mode module is on the system.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-is-block-algorithm">
+ <refnamediv>
+ <refname>mcrypt_module_is_block_algorithm</refname>
+ <refpurpose>
+ 指定したアルゴリズムがブロックアルゴリズムであるかを調べる
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>mcrypt_module_is_block_algorithm</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns TRUE if the specified algorithm is a block
+ algorithm, or FALSE is it is a stream algorithm.
+ The optional <parameter>lib_dir</parameter> parameter can contain
+ the location where the algorithm module is on the system.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-is-block-mode">
+ <refnamediv>
+ <refname>mcrypt_module_is_block_mode</refname>
+ <refpurpose>
+ 指定したモードがブロック出力を行うかどうかを返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>bool <function>mcrypt_module_is_block_mode</function></funcdef>
+ <paramdef>string <parameter>mode</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns TRUE if the mode outputs blocks of bytes or
+ FALSE if it outputs just bytes. (eg. 1 for cbc and ecb, and 0 for cfb
+ and stream). The optional <parameter>lib_dir</parameter> parameter
+ can contain the location where the mode module is on the system.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-get-algo-block-size">
+ <refnamediv>
+ <refname>mcrypt_module_get_algo_block_size</refname>
+ <refpurpose>指定したアルゴリズムのブロック長を返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_module_get_algo_block_size</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the block size of the algorithm specified in
+ bytes. The optional <parameter>lib_dir</parameter> parameter
+ can contain the location where the mode module is on the system.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-get-algo-key-size">
+ <refnamediv>
+ <refname>mcrypt_module_get_algo_key_size</refname>
+ <refpurpose>オープンされたモードでサポートされる最大キー長を返す</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>mcrypt_module_get_algo_key_size</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string <parameter><optional>lib_dir</optional></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns the maximum supported key size of the
+ algorithm specified in bytes. The optional
+ <parameter>lib_dir</parameter> parameter can contain the
+ location where the mode module is on the system.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.mcrypt-module-get-algo-supported-key-sizes">
+ <refnamediv>
+ <refname>mcrypt_module_get_algo_supported_key_sizes</refname>
+ <refpurpose>
+ オープンされたアルゴリズムでサポートされるキーのサイズを配列として返す
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>array <function>mcrypt_module_enc_get_algo_supported_key_sizes</function></funcdef>
+ <paramdef>string <parameter>algorithm</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>lib_dir</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 指定したアルゴリズムでサポートされるキーのサイズを配列で返します。
+ この関数が空の配列を返した場合、全てのキーのサイズは1から
+ そのアルゴリズムでサポートされた
+ <function>mcrypt_module_get_algo_key_size</function>
+ の返り値の間です。オプションのパラメータ
+ <parameter>lib_dir</parameter>によりシステムで mode モジュールが
+ ある場所を指定することが可能です。
+ </para>
+ </refsect1>
+ </refentry>
+
</reference>
<!-- Keep this comment at the end of the file
Index: phpdoc/ja/functions/network.xml
diff -u phpdoc/ja/functions/network.xml:1.8 phpdoc/ja/functions/network.xml:1.9
--- phpdoc/ja/functions/network.xml:1.8 Fri Aug 11 03:47:20 2000
+++ phpdoc/ja/functions/network.xml Fri Aug 11 21:15:42 2000
@@ -457,7 +457,7 @@
文字列<parameter>ident</parameter>は、各メッセージに
追加されます。<parameter>option</parameter>および
<parameter>facility</parameter>の値は、次節で説明します。
- <function>openlog</function>の使用はオプションで、必要な場合に
+ <function>openlog</function>の使用はオプショで、必要な場合に
<function>syslog</function>により自動的に呼び出されます。
この場合、<parameter>ident</parameter>のデフォルト値はfalseとなります。
</para>
@@ -561,6 +561,71 @@
<para>
Windows NTでは、syslogサービスはイベントログによりエミュレート
されます。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ip2long">
+ <refnamediv>
+ <refname>ip2long</refname>
+ <refpurpose>
+ (IPv4) インターネットプロトコルのドット表記のアドレスを有する文字
+ 列を適当なアドレスに変換する
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>ip2long</function></funcdef>
+ <paramdef>string <parameter>ip_address</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 関数 <function>ip2long</function> は、インターネット標準フォーマッ
+ ト(ドット表記の文字列)表記からIPv4 インターネットネットワークアド
+ レスに変換します。
+ <example>
+ <title><function>ip2long</function> の例</title>
+ <programlisting role="php">
+<?
+$ip = gethostbyname("www.php.net");
+$out = "The following URLs are equivalent:<br>\n";
+$out .= "http://www.php.net/, http://".$ip."/, and http://".ip2long($ip)."/<br>\n";
+echo $out;
+?>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ <function>long2ip</function>も参照下さい。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.long2ip">
+ <refnamediv>
+ <refname>long2ip</refname>
+ <refpurpose>
+ (IPv4) インターネットネットワークアドレスをインターネット標準ドッ
+ ト表記フォーマットに変換する
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>long2ip</function></funcdef>
+ <paramdef>int <parameter>proper_address</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ 関数 <function>long2ip</function> は、適当なアドレス表記からドッ
+ ト形式(すなわち、aaa.bbb.ccc.ddd)のインターネットアドレスを生成し
+ ます。
+ </para>
+ <para>
+ <function>ip2long</function>も参照下さい。
</para>
</refsect1>
</refentry>
Index: phpdoc/ja/functions/oci8.xml
diff -u phpdoc/ja/functions/oci8.xml:1.6 phpdoc/ja/functions/oci8.xml:1.7
--- phpdoc/ja/functions/oci8.xml:1.6 Fri Aug 11 06:11:10 2000
+++ phpdoc/ja/functions/oci8.xml Fri Aug 11 21:15:42 2000
@@ -247,8 +247,8 @@
$c2 = ocilogon("scott","tiger",$db);
function create_table($conn)
-{ $stmt = ociparse($conn,"create table scott.hallo (test
-varchar2(64))");
+{
+ $stmt = ociparse($conn,"create table scott.hallo (test varchar2(64))");
ociexecute($stmt);
echo $conn." created table\n\n";
}
@@ -260,7 +260,9 @@
}
function insert_data($conn)
-{ $stmt = ociparse($conn,"insert into scott.hallo values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
+{
+ $stmt = ociparse($conn,"insert into scott.hallo
+ values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
ociexecute($stmt,OCI_DEFAULT);
echo $conn." inserted hallo\n\n";
}
@@ -662,7 +664,8 @@
// $lob_upload はアップロードファイルのテンポラリファイル名を有しています
$conn = OCILogon($user, $password);
$lob = OCINewDescriptor($conn, OCI_D_LOB);
- $stmt = OCIParse($conn,"insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob");
+ $stmt = OCIParse($conn,"insert into $table (id, the_blob)
+ values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob");
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
OCIExecute($stmt);
if($lob->savefile($lob_upload)){
Index: phpdoc/ja/functions/strings.xml
diff -u phpdoc/ja/functions/strings.xml:1.14 phpdoc/ja/functions/strings.xml:1.15
--- phpdoc/ja/functions/strings.xml:1.14 Mon Aug 7 21:28:30 2000
+++ phpdoc/ja/functions/strings.xml Fri Aug 11 21:15:42 2000
@@ -334,6 +334,30 @@
</refsect1>
</refentry>
+ <refentry id="function.crc32">
+ <refnamediv>
+ <refname>crc32</refname>
+ <refpurpose>文字列の crc32 多項式計算を行う</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>crc32</function></funcdef>
+ <paramdef>string <parameter>str</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <parameter>str</parameter>の32ビット長のCRC(cyclic redundancy
+ checksum)チェックサムを生成します。これは、受信されたデータの整合
+ 性を検証するために通常使用されます。
+ </para>
+ <para>
+ <function>md5</function>も参照下さい。
+ </para>
+ </refsect1>
+ </refentry>
+
<refentry id="function.crypt">
<refnamediv>
<refname>crypt</refname>
@@ -407,6 +431,9 @@
<function>crypt</function> は単方向アルゴリズムを使用している
ため、復号化するための関数 (decrypt) はありません。
</simpara>
+ <simpara>
+ <function>md5</function>も参照下さい。
+ </simpara>
</refsect1>
</refentry>
@@ -478,8 +505,7 @@
</funcsynopsis>
<para>
文字列の配列を返します。この配列の各要素は、
- <parameter>string</parameter> を文ÿ
- <parameter>separator</parameter> で区切った部分文字列となります。
+ <parameter>string</parameter> を文嗃ߊ <parameter>separator</parameter> で区切った部分文字列となります。
<parameter>limit</parameter> が指定された場合、返される配列には
最大 <parameter>limit</parameter> の要素が含まれ、その最後の要素には
<parameter>string</parameter> の残りの部分が全て含まれます。
@@ -633,6 +659,66 @@
</refsect1>
</refentry>
+ <refentry id="function.hebrev">
+ <refnamediv>
+ <refname>hebrev</refname>
+ <refpurpose>
+ Hebrew 論理テキストを可視テキストに変換
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>説明</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>hebrev</function></funcdef>
+ <paramdef>string <parameter>hebrew_text</parameter></paramdef>
+ <paramdef>int
+ <parameter><optional>max_chars_per_line</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ オプションのパラメータ <parameter>max_chars_per_line</parameter>
+ は、出力される行毎の最大文字数を示します。この関数は、単語の分断
+ を回避します。
+ </para>
+ <para>
+ <function>hebrevc</function>も参照下さい。
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.hebrevc">
+ <refnamediv>
+ <refname>hebrevc</refname>
+ <refpurpose>
+

