WS, prepare for new doc style

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@249417 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-12-30 13:15:56 +00:00
parent 6b20633e2a
commit 97d13aa377
37 changed files with 1246 additions and 1254 deletions

View file

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-cbc" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cbc</refname>
<refpurpose>Encrypt/decrypt data in CBC mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cbc</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cbc</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-cbc" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cbc</refname>
<refpurpose>Encrypt/decrypt data in CBC mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cbc</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cbc</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-cfb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cfb</refname>
<refpurpose>Encrypt/decrypt data in CFB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cfb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cfb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-cfb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_cfb</refname>
<refpurpose>Encrypt/decrypt data in CFB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cfb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_cfb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,76 +1,74 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-create-iv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mcrypt_create_iv</refname>
<refpurpose>
Create an initialization vector (IV) from a random source
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_create_iv</methodname>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>source</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_create_iv</function> is used to create an IV.
</para>
<para>
Parameter
<parameter>size</parameter> determines the size of the IV,
parameter <parameter>source</parameter> (defaults to random value)
specifies the source of the IV.
</para>
<para>
The source can be <constant>MCRYPT_RAND</constant> (system random
number generator), <constant>MCRYPT_DEV_RANDOM</constant> (read
data from <filename>/dev/random</filename>) and
<constant>MCRYPT_DEV_URANDOM</constant> (read data from
<filename>/dev/urandom</filename>). <constant>MCRYPT_RAND</constant>
is the only one supported on Windows because Windows (of course)
doesn't have <filename>/dev/random</filename> or
<filename>/dev/urandom</filename>.
</para>
<note>
<para>
When using <constant>MCRYPT_RAND</constant>, remember to call
<function>srand</function> before
<function>mcrypt_create_iv</function> to initialize the random
number generator; it is not seeded automatically like
<function>rand</function> is.
</para>
</note>
<para>
<example>
<title><function>mcrypt_create_iv</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-create-iv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mcrypt_create_iv</refname>
<refpurpose>Create an initialization vector (IV) from a random source</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_create_iv</methodname>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>source</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_create_iv</function> is used to create an IV.
</para>
<para>
Parameter
<parameter>size</parameter> determines the size of the IV,
parameter <parameter>source</parameter> (defaults to random value)
specifies the source of the IV.
</para>
<para>
The source can be <constant>MCRYPT_RAND</constant> (system random
number generator), <constant>MCRYPT_DEV_RANDOM</constant> (read
data from <filename>/dev/random</filename>) and
<constant>MCRYPT_DEV_URANDOM</constant> (read data from
<filename>/dev/urandom</filename>). <constant>MCRYPT_RAND</constant>
is the only one supported on Windows because Windows (of course)
doesn't have <filename>/dev/random</filename> or
<filename>/dev/urandom</filename>.
</para>
<note>
<para>
When using <constant>MCRYPT_RAND</constant>, remember to call
<function>srand</function> before
<function>mcrypt_create_iv</function> to initialize the random
number generator; it is not seeded automatically like
<function>rand</function> is.
</para>
</note>
<para>
<example>
<title><function>mcrypt_create_iv</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$size = mcrypt_get_iv_size(MCRYPT_CAST_256, MCRYPT_MODE_CFB);
$iv = mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);
?>
]]>
</programlisting>
</example>
</para>
<para>
The IV is only meant to give an alternative seed to the encryption
routines. This IV does not need to be secret at all, though it can be
desirable. You even can send it along with your ciphertext without
losing security.
</para>
<para>
More information can be found at <link
xlink:href="&url.mcrypt.iv;">&url.mcrypt.iv;</link>, <link
xlink:href="&url.mcrypt.bcm;">&url.mcrypt.bcm;</link> and in chapter 9.3 of
Applied Cryptography by Schneier (ISBN 0-471-11709-9) for a discussion of
this topic.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
<para>
The IV is only meant to give an alternative seed to the encryption
routines. This IV does not need to be secret at all, though it can be
desirable. You even can send it along with your ciphertext without
losing security.
</para>
<para>
More information can be found at <link
xlink:href="&url.mcrypt.iv;">&url.mcrypt.iv;</link>, <link
xlink:href="&url.mcrypt.bcm;">&url.mcrypt.bcm;</link> and in chapter 9.3 of
Applied Cryptography by Schneier (ISBN 0-471-11709-9) for a discussion of
this topic.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,53 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-decrypt" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_decrypt</refname>
<refpurpose>Decrypts crypttext with given parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_decrypt</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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 '<literal>\0</literal>'.
</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 '<literal>\0</literal>'.
</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 '<literal>\0</literal>'.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-decrypt" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_decrypt</refname>
<refpurpose>Decrypts crypttext with given parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_decrypt</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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 '<literal>\0</literal>'.
</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 '<literal>\0</literal>'.
</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 '<literal>\0</literal>'.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,42 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-ecb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ecb</refname>
<refpurpose>Deprecated: Encrypt/decrypt data in ECB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ecb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ecb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function is deprecated and should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-ecb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ecb</refname>
<refpurpose>Deprecated: Encrypt/decrypt data in ECB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ecb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ecb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function is deprecated and should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,45 +1,45 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-algorithms-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_algorithms_name</refname>
<refpurpose>Returns the name of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_enc_get_algorithms_name</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the name of the algorithm.
</para>
<para>
<example>
<title><function>mcrypt_enc_get_algorithms_name</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-enc-get-algorithms-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_algorithms_name</refname>
<refpurpose>Returns the name of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_enc_get_algorithms_name</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the name of the algorithm.
</para>
<para>
<example>
<title><function>mcrypt_enc_get_algorithms_name</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$td = mcrypt_module_open(MCRYPT_CAST_256, '', MCRYPT_MODE_CFB, '');
echo mcrypt_enc_get_algorithms_name($td). "\n";
$td = mcrypt_module_open('cast-256', '', MCRYPT_MODE_CFB, '');
echo mcrypt_enc_get_algorithms_name($td). "\n";
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
CAST-256
CAST-256
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_block_size</refname>
<refpurpose>Returns the blocksize of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_block_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the block size of the algorithm specified by
the encryption descriptor <parameter>td</parameter> in bytes.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-get-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_block_size</refname>
<refpurpose>Returns the blocksize of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_block_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the block size of the algorithm specified by
the encryption descriptor <parameter>td</parameter> in bytes.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-iv-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_iv_size</refname>
<refpurpose>Returns the size of the IV of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_iv_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<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 xml:id="function.mcrypt-enc-get-iv-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_iv_size</refname>
<refpurpose>Returns the size of the IV of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_iv_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_key_size</refname>
<refpurpose>Returns the maximum supported keysize of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_key_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the maximum supported key size of the
algorithm specified by the encryption descriptor
<parameter>td</parameter> in bytes.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-get-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_key_size</refname>
<refpurpose>Returns the maximum supported keysize of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_get_key_size</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the maximum supported key size of the
algorithm specified by the encryption descriptor
<parameter>td</parameter> in bytes.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,47 +1,47 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-modes-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_modes_name</refname>
<refpurpose>Returns the name of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_enc_get_modes_name</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the name of the mode.
</para>
<para>
<example>
<title><function>mcrypt_enc_get_modes_name</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-enc-get-modes-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_modes_name</refname>
<refpurpose>Returns the name of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_enc_get_modes_name</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the name of the mode.
</para>
<para>
<example>
<title><function>mcrypt_enc_get_modes_name</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$td = mcrypt_module_open (MCRYPT_CAST_256, '', MCRYPT_MODE_CFB, '');
echo mcrypt_enc_get_modes_name($td). "\n";
$td = mcrypt_module_open ('cast-256', '', 'ecb', '');
echo mcrypt_enc_get_modes_name($td). "\n";
?>
]]>
</programlisting>
<para>
Prints:
</para>
<screen>
</programlisting>
<para>
Prints:
</para>
<screen>
<![CDATA[
CFB
ECB
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-get-supported-key-sizes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_supported_key_sizes</refname>
<refpurpose>Returns an array with the supported keysizes of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_enc_get_supported_key_sizes</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<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>
<para>
<example>
<title><function>mcrypt_enc_get_supported_key_sizes</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-enc-get-supported-key-sizes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_get_supported_key_sizes</refname>
<refpurpose>Returns an array with the supported keysizes of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_enc_get_supported_key_sizes</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<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>
<para>
<example>
<title><function>mcrypt_enc_get_supported_key_sizes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$td = mcrypt_module_open('rijndael-256', '', 'ecb', '');
var_dump(mcrypt_enc_get_supported_key_sizes($td));
?>
]]>
</programlisting>
<para>
This will print:
</para>
<screen>
</programlisting>
<para>
This will print:
</para>
<screen>
<![CDATA[
array(3) {
[0]=>
@ -44,11 +44,11 @@ array(3) {
int(32)
}
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-is-block-algorithm-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_algorithm_mode</refname>
<refpurpose>Checks whether the encryption of the opened mode works on blocks</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_algorithm_mode</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode is for use with block algorithms,
otherwise it returns &false;. (e.g. &false; for stream, and &true; for cbc, cfb, ofb).
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-is-block-algorithm-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_algorithm_mode</refname>
<refpurpose>Checks whether the encryption of the opened mode works on blocks</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_algorithm_mode</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode is for use with block algorithms,
otherwise it returns &false;. (e.g. &false; for stream, and &true; for cbc, cfb, ofb).
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-is-block-algorithm" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_algorithm</refname>
<refpurpose>Checks whether the algorithm of the opened mode is a block algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_algorithm</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the algorithm is a block algorithm,
or &false; if it is a stream algorithm.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-is-block-algorithm" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_algorithm</refname>
<refpurpose>Checks whether the algorithm of the opened mode is a block algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_algorithm</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the algorithm is a block algorithm,
or &false; if it is a stream algorithm.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-is-block-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_mode</refname>
<refpurpose>Checks whether the opened mode outputs blocks</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_mode</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode outputs blocks of bytes or
&false; if it outputs bytes. (e.g. &true; for cbc and ecb, and &false; for cfb and
stream).
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-is-block-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_is_block_mode</refname>
<refpurpose>Checks whether the opened mode outputs blocks</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_enc_is_block_mode</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode outputs blocks of bytes or
&false; if it outputs bytes. (e.g. &true; for cbc and ecb, and &false; for cfb and
stream).
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-enc-self-test" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_self_test</refname>
<refpurpose>This function runs a self test on the opened module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_self_test</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function runs the self test on the algorithm specified by the
descriptor <parameter>td</parameter>. If the self test succeeds it returns &false;. In case
of an error, it returns &true;.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-enc-self-test" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_enc_self_test</refname>
<refpurpose>This function runs a self test on the opened module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_enc_self_test</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function runs the self test on the algorithm specified by the
descriptor <parameter>td</parameter>. If the self test succeeds it returns &false;. In case
of an error, it returns &true;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,59 +1,59 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-encrypt" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_encrypt</refname>
<refpurpose>Encrypts plaintext with given parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_encrypt</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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 '<literal>\0</literal>'. It is better not to use ASCII strings for
keys. It is recommended to use the mhash functions to create a key
from a string.
</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 '<literal>\0</literal>'. 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 '<literal>\0</literal>'.
</para>
<para>
<example>
<title><function>mcrypt_encrypt</function> Example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-encrypt" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_encrypt</refname>
<refpurpose>Encrypts plaintext with given parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_encrypt</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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 '<literal>\0</literal>'. It is better not to use ASCII strings for
keys. It is recommended to use the mhash functions to create a key
from a string.
</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 '<literal>\0</literal>'. 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 '<literal>\0</literal>'.
</para>
<para>
<example>
<title><function>mcrypt_encrypt</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
@ -66,22 +66,22 @@
echo strlen($crypttext) . "\n";
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
42
64
]]>
</screen>
</example>
</para>
<para>
See also <function>mcrypt_module_open</function> for a more advanced API
and an example.
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
<para>
See also <function>mcrypt_module_open</function> for a more advanced API
and an example.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,33 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.27 -->
<refentry xml:id='function.mcrypt-generic-deinit' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_deinit</refname>
<refpurpose>
This function deinitializes an encryption module
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_generic_deinit</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function terminates encryption specified by the encryption
descriptor (<parameter>td</parameter>). It clears all buffers, but does
not close the module. You need to call
<function>mcrypt_module_close</function> yourself. (But PHP does this for
you at the end of the script.) Returns &false; on error, or &true; on
success.
</para>
<para>
See for an example <function>mcrypt_module_open</function> and the
entry on <function>mcrypt_generic_init</function>.
</para>
</refsect1>
</refentry>
<refentry xml:id='function.mcrypt-generic-deinit' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_deinit</refname>
<refpurpose>This function deinitializes an encryption module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_generic_deinit</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function terminates encryption specified by the encryption
descriptor (<parameter>td</parameter>). It clears all buffers, but does
not close the module. You need to call
<function>mcrypt_module_close</function> yourself. (But PHP does this for
you at the end of the script.) Returns &false; on error, or &true; on
success.
</para>
<para>
See for an example <function>mcrypt_module_open</function> and the
entry on <function>mcrypt_generic_init</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,35 +1,35 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-generic-end" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_end</refname>
<refpurpose>This function terminates encryption</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_generic_end</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<refentry xml:id="function.mcrypt-generic-end" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_end</refname>
<refpurpose>This function terminates encryption</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_generic_end</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
<warning>
<para>
<warning>
<para>
This function is deprecated, use
<function>mcrypt_generic_deinit</function> instead. It can cause
crashes when used with <function>mcrypt_module_close</function> due to
multiple buffer frees.
</para>
</warning>
This function is deprecated, use
<function>mcrypt_generic_deinit</function> instead. It can cause
crashes when used with <function>mcrypt_module_close</function> due to
multiple buffer frees.
</para>
<para>
This function terminates encryption specified by the encryption
descriptor (<parameter>td</parameter>). Actually it clears all buffers,
and closes all the modules used. Returns &false; on error, or &true; on
success.
</para>
</refsect1>
</refentry>
</warning>
</para>
<para>
This function terminates encryption specified by the encryption
descriptor (<parameter>td</parameter>). Actually it clears all buffers,
and closes all the modules used. Returns &false; on error, or &true; on
success.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,48 +1,48 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-generic-init" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_init</refname>
<refpurpose>This function initializes all buffers needed for encryption</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_generic_init</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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.
</para>
<para>
The function returns a negative value on error, -3 when the key length
was incorrect, -4 when there was a memory allocation problem and any
other return value is an unknown error. If an error occurs a warning will
be displayed accordingly. &false; is returned if incorrect parameters
were passed.
</para>
<para>
You need to call this function before every call to
<function>mcrypt_generic</function> or
<function>mdecrypt_generic</function>.
</para>
<para>
See for an example <function>mcrypt_module_open</function>.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-generic-init" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic_init</refname>
<refpurpose>This function initializes all buffers needed for encryption</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_generic_init</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<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.
</para>
<para>
The function returns a negative value on error, -3 when the key length
was incorrect, -4 when there was a memory allocation problem and any
other return value is an unknown error. If an error occurs a warning will
be displayed accordingly. &false; is returned if incorrect parameters
were passed.
</para>
<para>
You need to call this function before every call to
<function>mcrypt_generic</function> or
<function>mdecrypt_generic</function>.
</para>
<para>
See for an example <function>mcrypt_module_open</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,57 +1,57 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-generic" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic</refname>
<refpurpose>This function encrypts data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_generic</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
This function encrypts data. The data is padded with "<literal>\0</literal>"
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>
<para>
If you want to store the encrypted data in a database make sure to store
the entire string as returned by mcrypt_generic, or the string will not
entirely decrypt properly. If your original string is 10 characters long
and the block size is 8 (use
<function>mcrypt_enc_get_block_size</function> to determine the
blocksize), you would need at least 16 characters in your database field.
Note the string returned by <function>mdecrypt_generic</function> will be
16 characters as well...use <function>rtrim</function>($str, "\0") to
remove the padding.
</para>
<para>
If you are for example storing the data in a MySQL database remember that
varchar fields automatically have trailing spaces removed during
insertion. As encrypted data can end in a space (ASCII 32), the data will
be damaged by this removal. Store data in a tinyblob/tinytext (or
larger) field instead.
</para>
<para>
The encryption handle should always be initialized with
<function>mcrypt_generic_init</function> with a key and an IV before
calling this function. Where the encryption is done, you should free the
encryption buffers by calling <function>mcrypt_generic_deinit</function>.
See <function>mcrypt_module_open</function> for an example.
</para>
<para>
See also <function>mdecrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-generic" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_generic</refname>
<refpurpose>This function encrypts data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_generic</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
This function encrypts data. The data is padded with "<literal>\0</literal>"
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>
<para>
If you want to store the encrypted data in a database make sure to store
the entire string as returned by mcrypt_generic, or the string will not
entirely decrypt properly. If your original string is 10 characters long
and the block size is 8 (use
<function>mcrypt_enc_get_block_size</function> to determine the
blocksize), you would need at least 16 characters in your database field.
Note the string returned by <function>mdecrypt_generic</function> will be
16 characters as well...use <function>rtrim</function>($str, "\0") to
remove the padding.
</para>
<para>
If you are for example storing the data in a MySQL database remember that
varchar fields automatically have trailing spaces removed during
insertion. As encrypted data can end in a space (ASCII 32), the data will
be damaged by this removal. Store data in a tinyblob/tinytext (or
larger) field instead.
</para>
<para>
The encryption handle should always be initialized with
<function>mcrypt_generic_init</function> with a key and an IV before
calling this function. Where the encryption is done, you should free the
encryption buffers by calling <function>mcrypt_generic_deinit</function>.
See <function>mcrypt_module_open</function> for an example.
</para>
<para>
See also <function>mdecrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,42 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-get-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_block_size</refname>
<refpurpose>Get the block size of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_block_size</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_block_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>module</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<function>mcrypt_get_block_size</function> is used to get the
size of a block of the specified <parameter>cipher</parameter> (in
combination with an encryption mode).
</para>
<para>
It is more useful to use the <function>mcrypt_enc_get_block_size</function>
function as this uses the resource returned by
<function>mcrypt_module_open</function>.
</para>
<para>
This example shows how to use this function when linked against libmcrypt
2.4.x and 2.5.x.
<example>
<title><function>mcrypt_get_block_size</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-get-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_block_size</refname>
<refpurpose>Get the block size of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_block_size</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_block_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>module</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<function>mcrypt_get_block_size</function> is used to get the
size of a block of the specified <parameter>cipher</parameter> (in
combination with an encryption mode).
</para>
<para>
It is more useful to use the <function>mcrypt_enc_get_block_size</function>
function as this uses the resource returned by
<function>mcrypt_module_open</function>.
</para>
<para>
This example shows how to use this function when linked against libmcrypt
2.4.x and 2.5.x.
<example>
<title><function>mcrypt_get_block_size</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo mcrypt_get_block_size('tripledes', 'ecb');
@ -45,16 +45,16 @@
Prints:
8
]]>
</programlisting>
</example>
</para>
<para>
See also: <function>mcrypt_get_key_size</function>,
<function>mcrypt_enc_get_block_size</function> and
<function>mcrypt_encrypt</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
<para>
See also: <function>mcrypt_get_key_size</function>,
<function>mcrypt_enc_get_block_size</function> and
<function>mcrypt_encrypt</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,35 +1,35 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-get-cipher-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_cipher_name</refname>
<refpurpose>Get the name of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_get_cipher_name</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_get_cipher_name</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_get_cipher_name</function> is used to get the
name of the specified cipher.
</para>
<para>
<function>mcrypt_get_cipher_name</function> takes the cipher
number as an argument (libmcrypt 2.2.x) or takes the cipher name
as an argument (libmcrypt 2.4.x or higher) and returns the name of the cipher
or &false;, if the cipher does not exist.
</para>
<para>
<example>
<title><function>mcrypt_get_cipher_name</function> Example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-get-cipher-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_cipher_name</refname>
<refpurpose>Get the name of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_get_cipher_name</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_get_cipher_name</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_get_cipher_name</function> is used to get the
name of the specified cipher.
</para>
<para>
<function>mcrypt_get_cipher_name</function> takes the cipher
number as an argument (libmcrypt 2.2.x) or takes the cipher name
as an argument (libmcrypt 2.4.x or higher) and returns the name of the cipher
or &false;, if the cipher does not exist.
</para>
<para>
<example>
<title><function>mcrypt_get_cipher_name</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$cipher = MCRYPT_TripleDES;
@ -37,17 +37,17 @@
echo mcrypt_get_cipher_name($cipher);
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
3DES
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,46 +1,44 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-get-iv-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_iv_size</refname>
<refpurpose>
Returns the size of the IV belonging to a specific cipher/mode combination
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_iv_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_get_iv_size</function> returns the size of
the Initialisation Vector (IV) in bytes. 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
or one of "ecb", "cbc", "cfb", "ofb", "nofb" or "stream". The IV is
ignored in ECB mode as this mode does not require it. You will need to
have the same IV (think: starting point) both at encryption and
decryption stages, otherwise your encryption will fail.
</para>
<para>
It is more useful to use the <function>mcrypt_enc_get_iv_size</function>
function as this uses the resource returned by
<function>mcrypt_module_open</function>.
</para>
<para>
<example>
<title><function>mcrypt_get_iv_size</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-get-iv-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_iv_size</refname>
<refpurpose>Returns the size of the IV belonging to a specific cipher/mode combination</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_iv_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_get_iv_size</function> returns the size of
the Initialisation Vector (IV) in bytes. 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
or one of "ecb", "cbc", "cfb", "ofb", "nofb" or "stream". The IV is
ignored in ECB mode as this mode does not require it. You will need to
have the same IV (think: starting point) both at encryption and
decryption stages, otherwise your encryption will fail.
</para>
<para>
It is more useful to use the <function>mcrypt_enc_get_iv_size</function>
function as this uses the resource returned by
<function>mcrypt_module_open</function>.
</para>
<para>
<example>
<title><function>mcrypt_get_iv_size</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo mcrypt_get_iv_size(MCRYPT_CAST_256, MCRYPT_MODE_CFB) . "\n";
@ -48,17 +46,17 @@
echo mcrypt_get_iv_size('des', 'ecb') . "\n";
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>mcrypt_get_block_size</function>,
<function>mcrypt_enc_get_iv_size</function> and
<function>mcrypt_create_iv</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
<para>
See also
<function>mcrypt_get_block_size</function>,
<function>mcrypt_enc_get_iv_size</function> and
<function>mcrypt_create_iv</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,40 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-get-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_key_size</refname>
<refpurpose>Get the key size of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_key_size</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_key_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>module</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<function>mcrypt_get_key_size</function> is used to get the size
of a key of the specified <parameter>cipher</parameter> (in
combination with an encryption mode).
</para>
<para>
This example shows how to use this function when linked against libmcrypt
2.4.x and 2.5.x. It is more useful to use the
<function>mcrypt_enc_get_key_size</function> function as this uses the
resource returned by <function>mcrypt_module_open</function>.
<refentry xml:id="function.mcrypt-get-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_get_key_size</refname>
<refpurpose>Get the key size of the specified cipher</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_key_size</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>int</type><methodname>mcrypt_get_key_size</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>module</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<function>mcrypt_get_key_size</function> is used to get the size
of a key of the specified <parameter>cipher</parameter> (in
combination with an encryption mode).
</para>
<para>
This example shows how to use this function when linked against libmcrypt
2.4.x and 2.5.x. It is more useful to use the
<function>mcrypt_enc_get_key_size</function> function as this uses the
resource returned by <function>mcrypt_module_open</function>.
<example>
<title><function>mcrypt_get_block_size</function> example</title>
<programlisting role="php">
<example>
<title><function>mcrypt_get_block_size</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo mcrypt_get_key_size('tripledes', 'ecb');
@ -43,17 +43,17 @@
Prints:
24
]]>
</programlisting>
</example>
</para>
<para>
See also: <function>mcrypt_get_block_size</function>,
<function>mcrypt_end_get_key_size</function> and
<function>mcrypt_encrypt</function>.
</para>
</programlisting>
</example>
</para>
<para>
See also: <function>mcrypt_get_block_size</function>,
<function>mcrypt_end_get_key_size</function> and
<function>mcrypt_encrypt</function>.
</para>
</refsect1>
</refentry>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,31 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-list-algorithms" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_algorithms</refname>
<refpurpose>Get an array of all supported ciphers</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_list_algorithms</methodname>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_list_algorithms</function> is used to get an
array of all supported algorithms in the <parameter>lib_dir</parameter> parameter.
</para>
<para>
<function>mcrypt_list_algorithms</function> takes an optional
<parameter>lib_dir</parameter> parameter which specifies the directory
where all algorithms are located. If not specifies, the value of the
mcrypt.algorithms_dir &php.ini; directive is used.
</para>
<para>
<example>
<title><function>mcrypt_list_algorithms</function> Example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-list-algorithms" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_algorithms</refname>
<refpurpose>Get an array of all supported ciphers</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_list_algorithms</methodname>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_list_algorithms</function> is used to get an
array of all supported algorithms in the <parameter>lib_dir</parameter> parameter.
</para>
<para>
<function>mcrypt_list_algorithms</function> takes an optional
<parameter>lib_dir</parameter> parameter which specifies the directory
where all algorithms are located. If not specifies, the value of the
mcrypt.algorithms_dir &php.ini; directive is used.
</para>
<para>
<example>
<title><function>mcrypt_list_algorithms</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$algorithms = mcrypt_list_algorithms("/usr/local/lib/libmcrypt");
@ -35,15 +35,15 @@
}
?>
]]>
</programlisting>
<para>
The above example will produce a list with all supported
algorithms in the "/usr/local/lib/libmcrypt" directory.
</para>
</example>
</programlisting>
<para>
The above example will produce a list with all supported
algorithms in the "/usr/local/lib/libmcrypt" directory.
</para>
</refsect1>
</refentry>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,32 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-list-modes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_modes</refname>
<refpurpose>Get an array of all supported modes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_list_modes</methodname>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_list_modes</function> is used to get an
array of all supported modes in the
<parameter>lib_dir</parameter>.
</para>
<para>
<function>mcrypt_list_modes</function> takes as optional
parameter a directory which specifies the directory where all
modes are located. If not specifies, the value of the
mcrypt.modes_dir &php.ini; directive is used.
</para>
<para>
<example>
<title><function>mcrypt_list_modes</function> Example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-list-modes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_list_modes</refname>
<refpurpose>Get an array of all supported modes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_list_modes</methodname>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
<function>mcrypt_list_modes</function> is used to get an
array of all supported modes in the
<parameter>lib_dir</parameter>.
</para>
<para>
<function>mcrypt_list_modes</function> takes as optional
parameter a directory which specifies the directory where all
modes are located. If not specifies, the value of the
mcrypt.modes_dir &php.ini; directive is used.
</para>
<para>
<example>
<title><function>mcrypt_list_modes</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$modes = mcrypt_list_modes();
@ -36,17 +36,17 @@
}
?>
]]>
</programlisting>
<para>
The above example will produce a list with all supported
algorithms in the default mode directory. If it is not set
with the ini directive mcrypt.modes_dir, the default directory
of mcrypt is used (which is /usr/local/lib/libmcrypt).
</para>
</example>
</programlisting>
<para>
The above example will produce a list with all supported
algorithms in the default mode directory. If it is not set
with the ini directive mcrypt.modes_dir, the default directory
of mcrypt is used (which is /usr/local/lib/libmcrypt).
</para>
</refsect1>
</refentry>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,27 +1,25 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.27 -->
<refentry xml:id='function.mcrypt-module-close' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_close</refname>
<refpurpose>
Close the mcrypt module
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_close</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function closes the specified encryption handle.
</para>
<para>
See <function>mcrypt_module_open</function> for an example.
</para>
</refsect1>
</refentry>
<refentry xml:id='function.mcrypt-module-close' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_close</refname>
<refpurpose>Close the mcrypt module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_close</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
</methodsynopsis>
<para>
This function closes the specified encryption handle.
</para>
<para>
See <function>mcrypt_module_open</function> for an example.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-get-algo-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_algo_block_size</refname>
<refpurpose>Returns the blocksize of the specified algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_module_get_algo_block_size</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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 xml:id="function.mcrypt-module-get-algo-block-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_algo_block_size</refname>
<refpurpose>Returns the blocksize of the specified algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_module_get_algo_block_size</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-get-algo-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_algo_key_size</refname>
<refpurpose>Returns the maximum supported keysize of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_module_get_algo_key_size</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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 xml:id="function.mcrypt-module-get-algo-key-size" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_algo_key_size</refname>
<refpurpose>Returns the maximum supported keysize of the opened mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mcrypt_module_get_algo_key_size</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,31 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.2 -->
<refentry xml:id="function.mcrypt-module-get-supported-key-sizes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_supported_key_sizes</refname>
<refpurpose>Returns an array with the supported keysizes of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_module_get_supported_key_sizes</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array with the key sizes supported by the specified algorithm.
If it returns an empty array then all key sizes between 1 and
<function>mcrypt_module_get_algo_key_size</function> are supported by the
algorithm. The optional <parameter>lib_dir</parameter> parameter can
contain the location where the mode module is on the system.
</para>
<para>
See also <function>mcrypt_enc_get_supported_key_sizes</function> which is
used on open encryption modules.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-module-get-supported-key-sizes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_get_supported_key_sizes</refname>
<refpurpose>Returns an array with the supported keysizes of the opened algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>mcrypt_module_get_supported_key_sizes</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array with the key sizes supported by the specified algorithm.
If it returns an empty array then all key sizes between 1 and
<function>mcrypt_module_get_algo_key_size</function> are supported by the
algorithm. The optional <parameter>lib_dir</parameter> parameter can
contain the location where the mode module is on the system.
</para>
<para>
See also <function>mcrypt_enc_get_supported_key_sizes</function> which is
used on open encryption modules.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-is-block-algorithm-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_algorithm_mode</refname>
<refpurpose>Returns if the specified module is a block algorithm or not</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_algorithm_mode</methodname>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode is for use with block
algorithms, otherwise it returns &false;. (e.g. &false; for stream, and
&true; 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 xml:id="function.mcrypt-module-is-block-algorithm-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_algorithm_mode</refname>
<refpurpose>Returns if the specified module is a block algorithm or not</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_algorithm_mode</methodname>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode is for use with block
algorithms, otherwise it returns &false;. (e.g. &false; for stream, and
&true; 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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-is-block-algorithm" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_algorithm</refname>
<refpurpose>This function checks whether the specified algorithm is a block algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_algorithm</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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 xml:id="function.mcrypt-module-is-block-algorithm" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_algorithm</refname>
<refpurpose>This function checks whether the specified algorithm is a block algorithm</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_algorithm</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-is-block-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_mode</refname>
<refpurpose>Returns if the specified mode outputs blocks or not</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_mode</methodname>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode outputs blocks of bytes or
&false; if it outputs just bytes. (e.g. &true; for cbc and ecb, and
&false; 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 xml:id="function.mcrypt-module-is-block-mode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_is_block_mode</refname>
<refpurpose>Returns if the specified mode outputs blocks or not</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_is_block_mode</methodname>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<para>
This function returns &true; if the mode outputs blocks of bytes or
&false; if it outputs just bytes. (e.g. &true; for cbc and ecb, and
&false; 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>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,41 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_open</refname>
<refpurpose>Opens the module of the algorithm and the mode to be used</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>mcrypt_module_open</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam><type>string</type><parameter>algorithm_directory</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>mode_directory</parameter></methodparam>
</methodsynopsis>
<para>
This function opens the module of the algorithm and the mode to be used.
The name of the algorithm is specified in algorithm, e.g. "twofish" or is
one of the MCRYPT_ciphername constants. The module is closed by calling
<function>mcrypt_module_close</function>. 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 directories that are used are the ones
that were compiled in into libmcrypt (usually /usr/local/lib/libmcrypt).
</para>
<para>
<example>
<title><function>mcrypt_module_open</function> examples</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-module-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_open</refname>
<refpurpose>Opens the module of the algorithm and the mode to be used</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>mcrypt_module_open</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam><type>string</type><parameter>algorithm_directory</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>mode_directory</parameter></methodparam>
</methodsynopsis>
<para>
This function opens the module of the algorithm and the mode to be used.
The name of the algorithm is specified in algorithm, e.g. "twofish" or is
one of the MCRYPT_ciphername constants. The module is closed by calling
<function>mcrypt_module_close</function>. 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 directories that are used are the ones
that were compiled in into libmcrypt (usually /usr/local/lib/libmcrypt).
</para>
<para>
<example>
<title><function>mcrypt_module_open</function> examples</title>
<programlisting role="php">
<![CDATA[
<?php
$td = mcrypt_module_open(MCRYPT_DES, '',
@ -44,20 +44,20 @@
$td = mcrypt_module_open('rijndael-256', '', 'ofb', '');
?>
]]>
</programlisting>
</example>
</para>
<para>
The first line in the example above will try to open the DES cipher from
the default directory and the EBC mode from the directory
<filename>/usr/lib/mcrypt-modes</filename>. The second example uses
strings as name for the cipher and mode, this only works when the
extension is linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<example>
<title>Using <function>mcrypt_module_open</function> in encryption</title>
<programlisting role="php">
</programlisting>
</example>
</para>
<para>
The first line in the example above will try to open the DES cipher from
the default directory and the EBC mode from the directory
<filename>/usr/lib/mcrypt-modes</filename>. The second example uses
strings as name for the cipher and mode, this only works when the
extension is linked against libmcrypt 2.4.x or 2.5.x.
</para>
<para>
<example>
<title>Using <function>mcrypt_module_open</function> in encryption</title>
<programlisting role="php">
<![CDATA[
<?php
/* Open the cipher */
@ -94,19 +94,19 @@
echo trim($decrypted) . "\n";
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>mcrypt_module_close</function>,
<function>mcrypt_generic</function>,
<function>mdecrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
<para>
See also
<function>mcrypt_module_close</function>,
<function>mcrypt_generic</function>,
<function>mdecrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,49 +1,49 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-module-self-test" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_self_test</refname>
<refpurpose>This function runs a self test on the specified module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_self_test</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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>
<para>
<example>
<title><function>mcrypt_module_self_test</function> example</title>
<programlisting role="php">
<refentry xml:id="function.mcrypt-module-self-test" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_module_self_test</refname>
<refpurpose>This function runs a self test on the specified module</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mcrypt_module_self_test</methodname>
<methodparam><type>string</type><parameter>algorithm</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>lib_dir</parameter></methodparam>
</methodsynopsis>
<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>
<para>
<example>
<title><function>mcrypt_module_self_test</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)) . "\n";
var_dump(mcrypt_module_self_test(MCRYPT_BOGUS_CYPHER));
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(false)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mcrypt-ofb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ofb</refname>
<refpurpose>Encrypt/decrypt data in OFB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ofb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ofb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<refentry xml:id="function.mcrypt-ofb" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mcrypt_ofb</refname>
<refpurpose>Encrypt/decrypt data in OFB mode</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ofb</methodname>
<methodparam><type>int</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>mcrypt_ofb</methodname>
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>iv</parameter></methodparam>
</methodsynopsis>
<para>
The first prototype is when linked against libmcrypt 2.2.x, the
second when linked against libmcrypt 2.4.x or higher. The
<parameter>mode</parameter> should be either
<constant>MCRYPT_ENCRYPT</constant> or
<constant>MCRYPT_DECRYPT</constant>.
</para>
<para>
This function should not be used anymore, see
<function>mcrypt_generic</function> and
<function>mdecrypt_generic</function> for replacements.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,34 +1,34 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mcrypt.xml, last change in rev 1.7 -->
<refentry xml:id="function.mdecrypt-generic" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mdecrypt_generic</refname>
<refpurpose>Decrypt data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mdecrypt_generic</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<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">
<refentry xml:id="function.mdecrypt-generic" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mdecrypt_generic</refname>
<refpurpose>Decrypt data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mdecrypt_generic</methodname>
<methodparam><type>resource</type><parameter>td</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
<?php
/* Data */
$key = 'this is a very long key, even too long for the cipher';
$plain_text = 'very important data';
/* Open module, and create IV */
/* Open module, and create IV */
$td = mcrypt_module_open('des', '', 'ecb', '');
$key = substr($key, 0, mcrypt_enc_get_key_size($td));
$iv_size = mcrypt_enc_get_iv_size($td);
@ -57,30 +57,30 @@
}
?>
]]>
</programlisting>
</example>
</para>
<para>
The above example shows how to check if the data before the encryption is
the same as the data after the decryption. It is very important to
reinitialize the encryption buffer with
<function>mcrypt_generic_init</function> before you try to decrypt the
data.
</para>
<para>
The decryption handle should always be initialized with
<function>mcrypt_generic_init</function> with a key and an IV before
calling this function. Where the encryption is done, you should free the
encryption buffers by calling <function>mcrypt_generic_deinit</function>.
See <function>mcrypt_module_open</function> for an example.
</para>
<para>
See also <function>mcrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
<para>
The above example shows how to check if the data before the encryption is
the same as the data after the decryption. It is very important to
reinitialize the encryption buffer with
<function>mcrypt_generic_init</function> before you try to decrypt the
data.
</para>
<para>
The decryption handle should always be initialized with
<function>mcrypt_generic_init</function> with a key and an IV before
calling this function. Where the encryption is done, you should free the
encryption buffers by calling <function>mcrypt_generic_deinit</function>.
See <function>mcrypt_module_open</function> for an example.
</para>
<para>
See also <function>mcrypt_generic</function>,
<function>mcrypt_generic_init</function>, and
<function>mcrypt_generic_deinit</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: