mcrypt_generic

(PHP 4 >= 4.0.2, PHP 5, PHP 7) This function encrypts data string mcrypt_generic ( resource $td, string $data ) 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 than the input, due to the padding of the data. If you want to store the encrypted data in

mcrypt_generic_init

(PHP 4 >= 4.0.2, PHP 5, PHP 7) This function initializes all buffers needed for encryption int mcrypt_generic_init ( resource $td, string $key, string $iv ) You need to call this function before every call to mcrypt_generic() or mdecrypt_generic(). Parameters: td The encryption descriptor. key The maximum length of the key should be

mcrypt_generic_end

(PHP 4 >= 4.0.2, PHP 5) This function terminates encryption bool mcrypt_generic_end ( resource $td ) This function terminates encryption specified by the encryption descriptor (td). Actually it clears all buffers, and closes all the modules used. Returns FALSE on error, or TRUE on success. mcrypt_generic_deinit() should be used instead of this function, as it can cause crash

mcrypt_generic_deinit

(PHP 4 >= 4.0.7, PHP 5, PHP 7) This function deinitializes an encryption module bool mcrypt_generic_deinit ( resource $td ) This function terminates encryption specified by the encryption descriptor (td). It clears all buffers, but does not close the module. You need to call mcrypt_module_close() yourself. (But PHP does this for you at the end of the script.) Parameters: td

mcrypt_encrypt

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Encrypts plaintext with given parameters string mcrypt_encrypt ( string $cipher, string $key, string $data, string $mode [, string $iv ] ) Encrypts the data and returns it. Parameters: cipher One of the MCRYPT_ciphername constants, or the name of the algorithm as string. key The key with which the data wi

mcrypt_enc_self_test

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Runs a self test on the opened module int mcrypt_enc_self_test ( resource $td ) This function runs the self test on the algorithm specified by the descriptor td. Parameters: td The encryption descriptor. Returns: If the self test succeeds it returns FALSE. In case of an error, it returns TRUE.

mcrypt_enc_is_block_mode

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Checks whether the opened mode outputs blocks bool mcrypt_enc_is_block_mode ( resource $td ) Tells whether the opened mode outputs blocks (e.g. TRUE for cbc and ecb, and FALSE for cfb and stream). Parameters: td The encryption descriptor. Returns: Returns TRUE if the mode outputs blocks of bytes, or FALSE if it o

mcrypt_enc_is_block_algorithm

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Checks whether the algorithm of the opened mode is a block algorithm bool mcrypt_enc_is_block_algorithm ( resource $td ) Tells whether the algorithm of the opened mode is a block algorithm. Parameters: td The encryption descriptor. Returns: Returns TRUE if the algorithm is a block algorithm or FALSE if it is a st

mcrypt_enc_is_block_algorithm_mode

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Checks whether the encryption of the opened mode works on blocks bool mcrypt_enc_is_block_algorithm_mode ( resource $td ) Tells whether the algorithm of the opened mode works on blocks (e.g. FALSE for stream, and TRUE for cbc, cfb, ofb).. Parameters: td The encryption descriptor. Returns: Returns TRUE if the mode

mcrypt_enc_get_supported_key_sizes

(PHP 4 >= 4.0.2, PHP 5, PHP 7) Returns an array with the supported keysizes of the opened algorithm array mcrypt_enc_get_supported_key_sizes ( resource $td ) Gets the supported key sizes of the opened algorithm. Parameters: td The encryption descriptor. Returns: Returns an array with the key sizes supported by the algorithm specified by the en