mcrypt_generic()
mcrypt_generic - This function encrypts data
Syntax
string mcrypt_generic (
resource $td,
string $data)
Arguments
- td - The encryption descriptor. The encryption handle should always be initialized with mcrypt_generic_init() with a key and an IV before calling this function. Where the encryption is done, you should free the encryption buffers by calling mcrypt_generic_deinit(). See mcrypt_module_open() for an example.
- data - The data to encrypt.
Description
This function encrypts data. The data is padded with " \0" to make sure the length of the data is n * blocksize. This function returns the encrypted data. Note that the length of the returned string can in fact be longer then the input, due to the padding of the data.
Version
PHP 4.0.2, 5
Return value
Returns the encrypted data.