I have the following code using for encryption
$key="company";
$value['service_id']="edit_details";
$encrypted_string=trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $value['service_id'], MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
and i used the below code for decryption
$key="company";
$serviceId=$encrypted_string;
$decrypted_string=trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($serviceId), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
I am not getting the original string edit_details.
I don't what is wrong in this.