The Mcrypt reversible encryption algorithm in PHP. What is the reversible Mcrypt encryption algorithm in PHP? Php Tutorial $ tdmcrypt_module_open (MCRYPT_DES, ecb,); use the MCRYPT_DES algorithm, ecb mode $ ivmcrypt_create_iv (mcrypt_enc_get_iv_size ($ t Mcrypt reversible encryption algorithm in PHP
$ Td = mcrypt_module_open (MCRYPT_DES, '', 'ECB ',''); // use the MCRYPT_DES algorithm in ecb mode.
$ Iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($ td), MCRYPT_RAND );
$ Ks = mcrypt_enc_get_key_size ($ td );
$ Key = "ery secret key"; // key
$ Key = substr (md5 ($ key), 0, $ ks );
Mcrypt_generic_init ($ td, $ key, $ iv); // initial processing
// Encryption
$ Encrypted = mcrypt_generic ($ td, 'This is very important data ');
// End processing
Mcrypt_generic_deinit ($ td );
// Initial decryption
Mcrypt_generic_init ($ td, $ key, $ iv );
// Decrypt
$ Decrypted = mdecrypt_generic ($ td, $ encrypted );
// End
Mcrypt_generic_deinit ($ td );
Mcrypt_module_close ($ td );
// After decryption, it may be followed up and should be removed
Echo trim ($ decrypted). "n ";
Mcrypt reversible encryption algorithm? Php Tutorial $ td = mcrypt_module_open (MCRYPT_DES, '', 'ECB ',''); // use the MCRYPT_DES algorithm, ecb mode $ iv = mcrypt_create_iv (signature ($ t...