mcrypt_module_open
This function opens the module of the algorithm and the mode to be used
Description
resourcemcrypt_module_open
stringalgorithm
stringalgorithm_directory
stringmode
stringmode_directory
This function opens the module of the algorithm and the mode
to be used. The name of the algorithm is specified in algorithm,
eg "twofish" or is one of the MCRYPT_ciphername constants.
The library is closed by calling
mcrypt_module_close, but there is no need
to call that function if mcrypt_generic_end
is called. Normally it returns an encryption descriptor, or
&false; on error.
The algorithm_directory and
mode_directory are used to locate the
encryption modules. When you supply a directory name, it is used.
When you set one of these to the empty string (""), the value set
by the mcrypt.algorithms_dir or
mcrypt.modes_dir ini-directive is used.
When these are not set, the default directory are used that are
compiled in into libmcrypt (usally /usr/local/lib/libmcrypt).
mcrypt_module_open Example
]]>
The above example will try to open the DES cipher
from the default directory and the EBC mode from the directory
/usr/lib/mcrypt-modes.