From 6074ccbeb70374cc9d8f145c8548b53253f7c5a9 Mon Sep 17 00:00:00 2001 From: Nikos Mavroyanopoulos Date: Wed, 25 Oct 2000 18:18:46 +0000 Subject: [PATCH] added reference to mhash_keygen_s2k git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@34523 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mhash.xml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/functions/mhash.xml b/functions/mhash.xml index 293e413f48..1cddbfae45 100644 --- a/functions/mhash.xml +++ b/functions/mhash.xml @@ -239,6 +239,43 @@ for ($i = 0; $i <= $nr; $i++) { + + + mhash_keygen_s2k + Generates a key + + + Description + + + string mhash_keygen_s2k + int hash + string password + string salt + int bytes + + + + Mhash_keygen_s2k generates a key that is + bytes 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 + hash algorithm to create the key. + The salt 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. + + + +