cvs: phpdoc /en/reference/mhash/functions mhash-count.xml mhash-get-block-size.xml mhash-get-hash-name.xml mhash-keygen-s2k.xml mhash.xml
| From: | Mehdi Achour | Date: | Sun, 21 Jan 2007 14:14:09 +0000 |
| Subject: | cvs: phpdoc /en/reference/mhash/functions mhash-count.xml mhash-get-block-size.xml mhash-get-hash-name.xml mhash-keygen-s2k.xml mhash.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969374935@lists.php.net to get a copy of this message | ||
didou Sun Jan 21 14:14:09 2007 UTC
Modified files:
/phpdoc/en/reference/mhash/functions mhash-count.xml
mhash-get-block-size.xml
mhash-get-hash-name.xml
mhash-keygen-s2k.xml mhash.xml
Log:
WS, preparing for new doc style
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-count.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-count.xml diff -u phpdoc/en/reference/mhash/functions/mhash-count.xml:1.3 phpdoc/en/reference/mhash/functions/mhash-count.xml:1.4 --- phpdoc/en/reference/mhash/functions/mhash-count.xml:1.3 Mon Dec 15 16:52:02 2003 +++ phpdoc/en/reference/mhash/functions/mhash-count.xml Sun Jan 21 14:14:08 2007 @@ -1,42 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-count"> - <refnamediv> - <refname>mhash_count</refname> - <refpurpose>Get the highest available hash id</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>int</type><methodname>mhash_count</methodname> - <void/> - </methodsynopsis> - <para> - <function>mhash_count</function> returns the highest available hash - id. Hashes are numbered from 0 to this hash id. - </para> - <para> - <example> - <title>Traversing all hashes</title> - <programlisting role="php"> +<!-- $Revision: 1.4 $ --> +<refentry id="function.mhash-count"> + <refnamediv> + <refname>mhash_count</refname> + <refpurpose>Get the highest available hash id</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>int</type><methodname>mhash_count</methodname> + <void/> + </methodsynopsis> + <para> + <function>mhash_count</function> returns the highest available hash + id. Hashes are numbered from 0 to this hash id. + </para> + <para> + <example> + <title>Traversing all hashes</title> + <programlisting role="php"> <![CDATA[ <?php $nr = mhash_count(); for ($i = 0; $i <= $nr; $i++) { - echo sprintf("The blocksize of %s is %d\n", + echo sprintf("The blocksize of %s is %d\n", mhash_get_hash_name($i), mhash_get_block_size($i)); } ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml diff -u phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.2 phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.3 --- phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.2 Wed Apr 17 06:40:23 2002 +++ phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml Sun Jan 21 14:14:09 2007 @@ -1,28 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-get-block-size"> - <refnamediv> - <refname>mhash_get_block_size</refname> - <refpurpose>Get the block size of the specified hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>int</type><methodname>mhash_get_block_size</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_get_block_size</function> is used to get the size - of a block of the specified <parameter>hash</parameter>. - </para> - <para> - <function>mhash_get_block_size</function> takes one argument, the - <parameter>hash</parameter> and returns the size in bytes or - &false;, if the <parameter>hash</parameter> does not exist. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<refentry id="function.mhash-get-block-size"> + <refnamediv> + <refname>mhash_get_block_size</refname> + <refpurpose>Get the block size of the specified hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>int</type><methodname>mhash_get_block_size</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_get_block_size</function> is used to get the size + of a block of the specified <parameter>hash</parameter>. + </para> + <para> + <function>mhash_get_block_size</function> takes one argument, the + <parameter>hash</parameter> and returns the size in bytes or + &false;, if the <parameter>hash</parameter> does not exist. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml diff -u phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.5 phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.6 --- phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.5 Fri Mar 11 16:11:50 2005 +++ phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml Sun Jan 21 14:14:09 2007 @@ -1,30 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-get-hash-name"> - <refnamediv> - <refname>mhash_get_hash_name</refname> - <refpurpose>Get the name of the specified hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash_get_hash_name</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_get_hash_name</function> is used to get the name - of the specified hash. - </para> - <para> - <function>mhash_get_hash_name</function> takes the hash id as an - argument and returns the name of the hash or &false;, if the hash - does not exist. - </para> - <para> - <example> - <title><function>mhash_get_hash_name</function> example</title> - <programlisting role="php"> +<!-- $Revision: 1.6 $ --> +<refentry id="function.mhash-get-hash-name"> + <refnamediv> + <refname>mhash_get_hash_name</refname> + <refpurpose>Get the name of the specified hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash_get_hash_name</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_get_hash_name</function> is used to get the name + of the specified hash. + </para> + <para> + <function>mhash_get_hash_name</function> takes the hash id as an + argument and returns the name of the hash or &false;, if the hash + does not exist. + </para> + <para> + <example> + <title><function>mhash_get_hash_name</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $hash = MHASH_MD5; @@ -32,17 +31,17 @@ echo mhash_get_hash_name($hash); ?> ]]> - </programlisting> - &example.outputs; - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ MD5 ]]> - </screen> - </example> - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml diff -u phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.3 phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.4 --- phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.3 Thu Dec 18 14:14:24 2003 +++ phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml Sun Jan 21 14:14:09 2007 @@ -1,42 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.7 --> - <refentry id="function.mhash-keygen-s2k"> - <refnamediv> - <refname>mhash_keygen_s2k</refname> - <refpurpose>Generates a key</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash_keygen_s2k</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - <methodparam><type>string</type><parameter>password</parameter></methodparam> - <methodparam><type>string</type><parameter>salt</parameter></methodparam> - <methodparam><type>int</type><parameter>bytes</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_keygen_s2k</function> generates a key that is - <parameter>bytes</parameter> long, from a user given password. - This is the Salted S2K algorithm as specified in the OpenPGP - document (RFC 2440). That algorithm will use the specified - <parameter>hash</parameter> algorithm to create the key. - The <parameter>salt</parameter> must be different and random - enough for every key you generate in order to create different keys. - That salt must be known when you check the keys, thus it is - a good idea to append the key to it. Salt has a fixed length - of 8 bytes and will be padded with zeros if you supply less bytes. - </para> - <para> - Keep in mind that user supplied passwords are not really suitable - to be used as keys in cryptographic algorithms, since users normally - choose keys they can write on keyboard. These passwords use - only 6 to 7 bits per character (or less). It is highly recommended - to use some kind of transformation (like this function) to the user - supplied key. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.4 $ --> +<refentry id="function.mhash-keygen-s2k"> + <refnamediv> + <refname>mhash_keygen_s2k</refname> + <refpurpose>Generates a key</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash_keygen_s2k</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + <methodparam><type>string</type><parameter>password</parameter></methodparam> + <methodparam><type>string</type><parameter>salt</parameter></methodparam> + <methodparam><type>int</type><parameter>bytes</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_keygen_s2k</function> generates a key that is + <parameter>bytes</parameter> long, from a user given password. + This is the Salted S2K algorithm as specified in the OpenPGP + document (RFC 2440). That algorithm will use the specified + <parameter>hash</parameter> algorithm to create the key. + The <parameter>salt</parameter> must be different and random + enough for every key you generate in order to create different keys. + That salt must be known when you check the keys, thus it is + a good idea to append the key to it. Salt has a fixed length + of 8 bytes and will be padded with zeros if you supply less bytes. + </para> + <para> + Keep in mind that user supplied passwords are not really suitable + to be used as keys in cryptographic algorithms, since users normally + choose keys they can write on keyboard. These passwords use + only 6 to 7 bits per character (or less). It is highly recommended + to use some kind of transformation (like this function) to the user + supplied key. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash.xml diff -u phpdoc/en/reference/mhash/functions/mhash.xml:1.2 phpdoc/en/reference/mhash/functions/mhash.xml:1.3 --- phpdoc/en/reference/mhash/functions/mhash.xml:1.2 Wed Apr 17 06:40:23 2002 +++ phpdoc/en/reference/mhash/functions/mhash.xml Sun Jan 21 14:14:09 2007 @@ -1,30 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash"> - <refnamediv> - <refname>mhash</refname> - <refpurpose>Compute hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash</function> applies a hash function specified by - <parameter>hash</parameter> to the <parameter>data</parameter> and - returns the resulting hash (also called digest). If the <parameter> key</parameter> - is specified it will return the resulting HMAC. HMAC is keyed hashing - for message authentication, or simply a message digest that depends on - the specified key. Not all algorithms supported in mhash can be used in - HMAC mode. In case of an error returns &false;. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<refentry id="function.mhash"> + <refnamediv> + <refname>mhash</refname> + <refpurpose>Compute hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + <methodparam><type>string</type><parameter>data</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash</function> applies a hash function specified by + <parameter>hash</parameter> to the <parameter>data</parameter> and + returns the resulting hash (also called digest). If the <parameter> key</parameter> + is specified it will return the resulting HMAC. HMAC is keyed hashing + for message authentication, or simply a message digest that depends on + the specified key. Not all algorithms supported in mhash can be used in + HMAC mode. In case of an error returns &false;. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables:
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-count.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-count.xml diff -u phpdoc/en/reference/mhash/functions/mhash-count.xml:1.3 phpdoc/en/reference/mhash/functions/mhash-count.xml:1.4 --- phpdoc/en/reference/mhash/functions/mhash-count.xml:1.3 Mon Dec 15 16:52:02 2003 +++ phpdoc/en/reference/mhash/functions/mhash-count.xml Sun Jan 21 14:14:08 2007 @@ -1,42 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-count"> - <refnamediv> - <refname>mhash_count</refname> - <refpurpose>Get the highest available hash id</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>int</type><methodname>mhash_count</methodname> - <void/> - </methodsynopsis> - <para> - <function>mhash_count</function> returns the highest available hash - id. Hashes are numbered from 0 to this hash id. - </para> - <para> - <example> - <title>Traversing all hashes</title> - <programlisting role="php"> +<!-- $Revision: 1.4 $ --> +<refentry id="function.mhash-count"> + <refnamediv> + <refname>mhash_count</refname> + <refpurpose>Get the highest available hash id</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>int</type><methodname>mhash_count</methodname> + <void/> + </methodsynopsis> + <para> + <function>mhash_count</function> returns the highest available hash + id. Hashes are numbered from 0 to this hash id. + </para> + <para> + <example> + <title>Traversing all hashes</title> + <programlisting role="php"> <![CDATA[ <?php $nr = mhash_count(); for ($i = 0; $i <= $nr; $i++) { - echo sprintf("The blocksize of %s is %d\n", + echo sprintf("The blocksize of %s is %d\n", mhash_get_hash_name($i), mhash_get_block_size($i)); } ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml diff -u phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.2 phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.3 --- phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml:1.2 Wed Apr 17 06:40:23 2002 +++ phpdoc/en/reference/mhash/functions/mhash-get-block-size.xml Sun Jan 21 14:14:09 2007 @@ -1,28 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-get-block-size"> - <refnamediv> - <refname>mhash_get_block_size</refname> - <refpurpose>Get the block size of the specified hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>int</type><methodname>mhash_get_block_size</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_get_block_size</function> is used to get the size - of a block of the specified <parameter>hash</parameter>. - </para> - <para> - <function>mhash_get_block_size</function> takes one argument, the - <parameter>hash</parameter> and returns the size in bytes or - &false;, if the <parameter>hash</parameter> does not exist. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<refentry id="function.mhash-get-block-size"> + <refnamediv> + <refname>mhash_get_block_size</refname> + <refpurpose>Get the block size of the specified hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>int</type><methodname>mhash_get_block_size</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_get_block_size</function> is used to get the size + of a block of the specified <parameter>hash</parameter>. + </para> + <para> + <function>mhash_get_block_size</function> takes one argument, the + <parameter>hash</parameter> and returns the size in bytes or + &false;, if the <parameter>hash</parameter> does not exist. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml diff -u phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.5 phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.6 --- phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml:1.5 Fri Mar 11 16:11:50 2005 +++ phpdoc/en/reference/mhash/functions/mhash-get-hash-name.xml Sun Jan 21 14:14:09 2007 @@ -1,30 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash-get-hash-name"> - <refnamediv> - <refname>mhash_get_hash_name</refname> - <refpurpose>Get the name of the specified hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash_get_hash_name</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_get_hash_name</function> is used to get the name - of the specified hash. - </para> - <para> - <function>mhash_get_hash_name</function> takes the hash id as an - argument and returns the name of the hash or &false;, if the hash - does not exist. - </para> - <para> - <example> - <title><function>mhash_get_hash_name</function> example</title> - <programlisting role="php"> +<!-- $Revision: 1.6 $ --> +<refentry id="function.mhash-get-hash-name"> + <refnamediv> + <refname>mhash_get_hash_name</refname> + <refpurpose>Get the name of the specified hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash_get_hash_name</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_get_hash_name</function> is used to get the name + of the specified hash. + </para> + <para> + <function>mhash_get_hash_name</function> takes the hash id as an + argument and returns the name of the hash or &false;, if the hash + does not exist. + </para> + <para> + <example> + <title><function>mhash_get_hash_name</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $hash = MHASH_MD5; @@ -32,17 +31,17 @@ echo mhash_get_hash_name($hash); ?> ]]> - </programlisting> - &example.outputs; - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ MD5 ]]> - </screen> - </example> - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml diff -u phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.3 phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.4 --- phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml:1.3 Thu Dec 18 14:14:24 2003 +++ phpdoc/en/reference/mhash/functions/mhash-keygen-s2k.xml Sun Jan 21 14:14:09 2007 @@ -1,42 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.7 --> - <refentry id="function.mhash-keygen-s2k"> - <refnamediv> - <refname>mhash_keygen_s2k</refname> - <refpurpose>Generates a key</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash_keygen_s2k</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - <methodparam><type>string</type><parameter>password</parameter></methodparam> - <methodparam><type>string</type><parameter>salt</parameter></methodparam> - <methodparam><type>int</type><parameter>bytes</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash_keygen_s2k</function> generates a key that is - <parameter>bytes</parameter> long, from a user given password. - This is the Salted S2K algorithm as specified in the OpenPGP - document (RFC 2440). That algorithm will use the specified - <parameter>hash</parameter> algorithm to create the key. - The <parameter>salt</parameter> must be different and random - enough for every key you generate in order to create different keys. - That salt must be known when you check the keys, thus it is - a good idea to append the key to it. Salt has a fixed length - of 8 bytes and will be padded with zeros if you supply less bytes. - </para> - <para> - Keep in mind that user supplied passwords are not really suitable - to be used as keys in cryptographic algorithms, since users normally - choose keys they can write on keyboard. These passwords use - only 6 to 7 bits per character (or less). It is highly recommended - to use some kind of transformation (like this function) to the user - supplied key. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.4 $ --> +<refentry id="function.mhash-keygen-s2k"> + <refnamediv> + <refname>mhash_keygen_s2k</refname> + <refpurpose>Generates a key</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash_keygen_s2k</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + <methodparam><type>string</type><parameter>password</parameter></methodparam> + <methodparam><type>string</type><parameter>salt</parameter></methodparam> + <methodparam><type>int</type><parameter>bytes</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash_keygen_s2k</function> generates a key that is + <parameter>bytes</parameter> long, from a user given password. + This is the Salted S2K algorithm as specified in the OpenPGP + document (RFC 2440). That algorithm will use the specified + <parameter>hash</parameter> algorithm to create the key. + The <parameter>salt</parameter> must be different and random + enough for every key you generate in order to create different keys. + That salt must be known when you check the keys, thus it is + a good idea to append the key to it. Salt has a fixed length + of 8 bytes and will be padded with zeros if you supply less bytes. + </para> + <para> + Keep in mind that user supplied passwords are not really suitable + to be used as keys in cryptographic algorithms, since users normally + choose keys they can write on keyboard. These passwords use + only 6 to 7 bits per character (or less). It is highly recommended + to use some kind of transformation (like this function) to the user + supplied key. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mhash/functions/mhash.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/mhash/functions/mhash.xml diff -u phpdoc/en/reference/mhash/functions/mhash.xml:1.2 phpdoc/en/reference/mhash/functions/mhash.xml:1.3 --- phpdoc/en/reference/mhash/functions/mhash.xml:1.2 Wed Apr 17 06:40:23 2002 +++ phpdoc/en/reference/mhash/functions/mhash.xml Sun Jan 21 14:14:09 2007 @@ -1,30 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 --> - <refentry id="function.mhash"> - <refnamediv> - <refname>mhash</refname> - <refpurpose>Compute hash</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> - <type>string</type><methodname>mhash</methodname> - <methodparam><type>int</type><parameter>hash</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam> - </methodsynopsis> - <para> - <function>mhash</function> applies a hash function specified by - <parameter>hash</parameter> to the <parameter>data</parameter> and - returns the resulting hash (also called digest). If the <parameter> key</parameter> - is specified it will return the resulting HMAC. HMAC is keyed hashing - for message authentication, or simply a message digest that depends on - the specified key. Not all algorithms supported in mhash can be used in - HMAC mode. In case of an error returns &false;. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<refentry id="function.mhash"> + <refnamediv> + <refname>mhash</refname> + <refpurpose>Compute hash</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <methodsynopsis> + <type>string</type><methodname>mhash</methodname> + <methodparam><type>int</type><parameter>hash</parameter></methodparam> + <methodparam><type>string</type><parameter>data</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam> + </methodsynopsis> + <para> + <function>mhash</function> applies a hash function specified by + <parameter>hash</parameter> to the <parameter>data</parameter> and + returns the resulting hash (also called digest). If the <parameter> key</parameter> + is specified it will return the resulting HMAC. HMAC is keyed hashing + for message authentication, or simply a message digest that depends on + the specified key. Not all algorithms supported in mhash can be used in + HMAC mode. In case of an error returns &false;. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: