cvs: phpdoc /en/functions mhash.xml

From: Date: Sat, 23 Dec 2000 16:19:35 +0000
Subject: cvs: phpdoc /en/functions mhash.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333365@lists.php.net to get a copy of this message
goba Sat Dec 23 08:19:35 2000 EDT Modified files: /phpdoc/en/functions mhash.xml Log: Correcting a fault of myself...

Index: phpdoc/en/functions/mhash.xml diff -u phpdoc/en/functions/mhash.xml:1.10 phpdoc/en/functions/mhash.xml:1.11 --- phpdoc/en/functions/mhash.xml:1.10 Sat Dec 23 08:15:15 2000 +++ phpdoc/en/functions/mhash.xml Sat Dec 23 08:19:35 2000 @@ -1,61 +1,54 @@ <reference id="ref.mhash"> - <title>Mhash függvények</title> + <title>Mhash Functions</title> <titleabbrev>mhash</titleabbrev> <partintro> <para> - Ezek a függvények az <ulink url="&url.mhash;">mhash</ulink>-el - mûködnek együtt. - </para> + These functions are intended to work with <ulink + url="&url.mhash;">mhash</ulink>.</para> <para> - Ezek egy felületet biztosítanak az mhash könyvtárhoz. Az mhash - széles skáláját támogatja a hash algoritmusoknak, mint például - az MD5, SHA1, GOST és számos más. + This is an interface to the mhash library. mhash supports a wide + variety of hash algorithms such as MD5, SHA1, GOST, and many + others. </para> <para> - Ahhoz, hogy használhasd ezeket, le kell töltened az mhash - csomagot az <ulink url="&url.mhash;">mhash webhelyrõl</ulink> - és követned kell a telepítési utasításokat, amiket a csomagban - találsz. A PHP-t a <option role="configure">--with-mhash</option> - paraméterrel kell fordítanod, hogy engedélyezd ezt a kiterjesztést. + To use it, download the mhash distribution from <ulink + url="&url.mhash;">its web site</ulink> and follow the included + installation instructions. You need to compile PHP with the + <option role="configure">--with-mhash</option> parameter to enable + this extension. </para> <para> - Az mhash például ellenõrzõösszegek, kivonatok, azonosítási kódok - elõállítására is használható. + Mhash can be used to create checksums, message digests, message + authentication codes, and more. </para> <para> <example> - <title>Az MD5 kivonat és a hmac elõállítása és kiírása hexa formában</title> + <title>Compute the MD5 digest and hmac and print it out as hex</title> <programlisting role="php"> -<![CDATA[ -<?php +&lt;?php $input = "what do ya want for nothing?"; $hash = mhash (MHASH_MD5, $input); print "The hash is ".bin2hex ($hash)."\n&lt;br>"; $hash = mhash (MHASH_MD5, $input, "Jefe"); print "The hmac is ".bin2hex ($hash)."\n&lt;br>"; -?> -]]> +?&gt; </programlisting> </example> - Ez a következõ kimenetet eredményezi: + This will produce: <programlisting> -<![CDATA[ The hash is d03cb659cbf9192dcd066272249f8412 The hmac is 750c783e6ab0b503eaa86e310a5db738 -]]> </programlisting> - A támogatott hash-ek teljes listájához nézd meg az - mhash dokumentációt. Az általános szabály, hogy a hash - algoritmust az MHASH_HASHNEVE formában tudod elérni - PHP-bõl. Például a TIGER eléréséhez az MHASH_TIGER - PHP konstans használható. + For a complete list of supported hashes, refer to the + documentation of mhash. The general rule is that you can access + the hash algorithm from PHP with MHASH_HASHNAME. For example, to + access TIGER you use the PHP constant MHASH_TIGER. </para> <para> - Itt következnek az mhash által jelenleg támogatott hash-ek. - Ha találsz az mhash dokumentációban itt nem listázott elemet, - nyugodtan feltételezheted, hogy az használható, és ez a dokumentáció - nem aktuális. + Here is a list of hashes which are currently supported by mhash. If a + hash is not listed here, but is listed by mhash as supported, you can + safely assume that this documentation is outdated. <itemizedlist> <listitem> <simpara> @@ -119,10 +112,10 @@ <refentry id="function.mhash-get-hash-name"> <refnamediv> <refname>mhash_get_hash_name</refname> - <refpurpose>A megadott hash nevét adja vissza</refpurpose> + <refpurpose>Get the name of the specified hash</refpurpose> </refnamediv> <refsect1> - <title>Leírás</title> + <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mhash_get_hash_name</function></funcdef> @@ -130,27 +123,26 @@ </funcprototype> </funcsynopsis> <para> - Az <function>mhash_get_hash_name</function> a megadott hash nevével - tér vissza. + <function>Mhash_get_hash_name</function> is used to get the name + of the specified hash. </para> <para> - Ha az <function>mhash_get_hash_name</function> függvénynek átadott - hash azonosító egy nemlétezõ hash-re hivatkozik, FALSE értékkel tér vissza. + <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> példa</title> + <title><function>Mhash_get_hash_name</function> Example</title> <programlisting> -<![CDATA[ -<?php +&lt;?php $hash = MHASH_MD5; print mhash_get_hash_name ($hash); -?> -]]> +?&gt; </programlisting> </example> - Ez a következõ kimenetet eredményezi: + The above example will print out: <programlisting> MD5 </programlisting> @@ -161,10 +153,10 @@ <refentry id="function.mhash-get-block-size"> <refnamediv> <refname>mhash_get_block_size</refname> - <refpurpose>A megadott hash blokkméretével tér vissza</refpurpose> + <refpurpose>Get the block size of the specified hash</refpurpose> </refnamediv> <refsect1> - <title>Leírás</title> + <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mhash_get_block_size</function></funcdef> @@ -172,14 +164,13 @@ </funcprototype> </funcsynopsis> <para> - Az <function>mhash_get_block_size</function> a megadott - <parameter>hash</parameter> blokkméretét adja vissza - byte-okban mérve. + <function>Mhash_get_block_size</function> is used to get the size + of a block of the specified <parameter>hash</parameter>. </para> <para> - Ha az <function>mhash_get_block_size</function> - függvénynek érvénytelen <parameter>hash</parameter> - paramétert adsz, FALSE értékkel tér vissza. + <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> @@ -187,10 +178,10 @@ <refentry id="function.mhash-count"> <refnamediv> <refname>mhash_count</refname> - <refpurpose>Visszaadja a legnagyobb elérhetõ hash azonosítót</refpurpose> + <refpurpose>Get the highest available hash id</refpurpose> </refnamediv> <refsect1> - <title>Leírás</title> + <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mhash_count</function></funcdef> @@ -198,16 +189,14 @@ </funcprototype> </funcsynopsis> <para> - Az <function>mhash_count</function> visszaadja a legnagyobb elérhetõ - hash azonosítót. A hash-ek nullától eddig a számig kapnak - azonosító számokat. + <function>Mhash_count</function> returns the highest available hash + id. Hashes are numbered from 0 to this hash id. </para> <para> <example> - <title>Az összes hash használata</title> + <title>Traversing all hashes</title> <programlisting role="php"> -<![CDATA[ -<?php +&lt;?php $nr = mhash_count(); @@ -216,7 +205,7 @@ mhash_get_hash_name ($i), mhash_get_block_size ($i)); } -?> +?&gt; </programlisting> </example> </para> @@ -226,10 +215,10 @@ <refentry id="function.mhash"> <refnamediv> <refname>mhash</refname> - <refpurpose>Hash számítás</refpurpose> + <refpurpose>Compute hash</refpurpose> </refnamediv> <refsect1> - <title>Leírás</title> + <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mhash</function></funcdef> @@ -239,14 +228,13 @@ </funcprototype> </funcsynopsis> <para> - Az <function>mhash</function> alkalmazza a <parameter>hash</parameter> - által megadott algoritmust a <parameter>data</parameter> paraméterre, és - visszatér az eredmény hash-el (amit kivonatkank [digest-nek] is hívnak). - Ha a <parameter>key</parameter> paramétert is megadod, visszaadja - az keletkezõ HMAC-ot. A HMAC egy kulcsos hash-elés üzenet azonosításra, - vagy csak egyszerûen egy üzenet kivonat ami egy megadott kulcstól - függ. Nem minden mhash algoritmus használható HMAC módban. - Hiba esetén a függvény FALSE értéket ad. + <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> @@ -254,10 +242,10 @@ <refentry id="function.mhash-keygen-s2k"> <refnamediv> <refname>mhash_keygen_s2k</refname> - <refpurpose>Kulcsot generál</refpurpose> + <refpurpose>Generates a key</refpurpose> </refnamediv> <refsect1> - <title>Leírás</title> + <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mhash_keygen_s2k</function></funcdef> @@ -268,24 +256,22 @@ </funcprototype> </funcsynopsis> <para> - Az <function>mhash_keygen_s2k</function> egy olyan kulcsot generál, - ami <parameter>bytes</parameter> hosszú, és a megadott jelszót - figyelembe véve készül. Az S2K algoritmust használja, ami az OpenPGP - dokumentumban (RFC 2440) definiált. A megadott - <parameter>hash</parameter> algortmust használja a kulcs elõállítására. - A <parameter>salt</parameter> minden generált kulcsra más-más - kell legyen, kellõkképpen véletlenszerû értékekkel, hogy különbözõ - kulcsok álljanak elõ. A salt-nak ismertnek kell lennie, - amikor ellenõrzöd a kulcsokat, tehát jó ötlet ehhez fûzni - a kulcsokat. A salt-nak mindig nyolc karakter hosszúnak kell - lennie, ha rövidebbet adsz meg, nulákkal töltõdik fel. - Tartsd szem elõtt, hogy a felhasználók által beadott jelszavak - nem túlságosan alkalmasak titkosítási rendszerek kulcsaiként, - mivel a felhasználók általában jól begépelhetõ kulcsot - választanak. Ezek a jelszavak csak 6-7 bitet (vagy még - kevesebbet) használnak ki karakterenként. Nagyon ajánlott - a beadott jelszóra egy olyan átalakítás használata, mint - ez a függvény. + <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. + 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 tranformation (like this function) to the user + supplied key. </para> </refsect1> </refentry>
« previous php.doc (#969333365) next »