Correcting a fault of myself...

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@38213 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2000-12-23 16:19:35 +00:00
parent 331152a677
commit 4500c66f57

View file

@ -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.
These functions are intended to work with <ulink
url="&url.mhash;">mhash</ulink>.</para>
<para>
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>
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.
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>
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.
</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 @@ The hmac is 750c783e6ab0b503eaa86e310a5db738
<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 @@ The hmac is 750c783e6ab0b503eaa86e310a5db738
</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 @@ MD5
<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 @@ MD5
</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 @@ MD5
<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 @@ MD5
</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 @@ for ($i = 0; $i &lt;= $nr; $i++) {
mhash_get_hash_name ($i),
mhash_get_block_size ($i));
}
?>
?&gt;
</programlisting>
</example>
</para>
@ -226,10 +215,10 @@ for ($i = 0; $i &lt;= $nr; $i++) {
<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 @@ for ($i = 0; $i &lt;= $nr; $i++) {
</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 @@ for ($i = 0; $i &lt;= $nr; $i++) {
<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 @@ for ($i = 0; $i &lt;= $nr; $i++) {
</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>