Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 1553

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>mhash_keygen_s2k</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
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-1"></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"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.mhash-get-hash-name.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.mhash.html"
ACCESSKEY="N"
>Next</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="AEN51486"
></A
><P
>    (PHP 4 &#62;= 4.0.4)</P
>mhash_keygen_s2k&nbsp;--&nbsp;Generates a key</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN51489"
></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
     <TT
CLASS="parameter"
><I
>bytes</I
></TT
> 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
     <TT
CLASS="parameter"
><I
>hash</I
></TT
> algorithm to create the key.
     The <TT
CLASS="parameter"
><I
>salt</I
></TT
> 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 tranformation (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"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.mhash.html"
ACCESSKEY="N"
>Next</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"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mhash</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>