Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 1833

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>mhash_keygen_s2k</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Mhash Functions"
HREF="ref.mhash.html"><LINK
REL="PREVIOUS"
TITLE="mhash_get_hash_name"
HREF="function.mhash-get-hash-name.html"><LINK
REL="NEXT"
TITLE="mhash"
HREF="function.mhash.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.mhash-get-hash-name.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.mhash.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.mhash-keygen-s2k"
></A
>mhash_keygen_s2k</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN59558"
></A
><P
>    (PHP 4 &#62;= 4.0.4, PHP 5)</P
>mhash_keygen_s2k&nbsp;--&nbsp;Generates a key</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN59561"
></A
><H2
>Description</H2
>string <B
CLASS="methodname"
>mhash_keygen_s2k</B
> ( int hash, string password, string salt, int bytes)<BR
></BR
><P
>&#13;     <B
CLASS="function"
>mhash_keygen_s2k()</B
> generates a key that is
     <VAR
CLASS="parameter"
>bytes</VAR
> 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
     <VAR
CLASS="parameter"
>hash</VAR
> algorithm to create the key.
     The <VAR
CLASS="parameter"
>salt</VAR
> 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.
    </P
><P
>&#13;     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.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.mhash-get-hash-name.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.mhash.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>mhash_get_hash_name</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.mhash.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mhash</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>