code: public static function decrypt($data, $key, $cipher = MCRYPT_RIJNDAEL_128, $mode = MCRYPT_MODE_CBC)
      {
          $key    =   hash('sha256', $key, true);
  
          @ list($iv, $encrypted) = (array) unserialize(base64_decode($data));
  
          return unserialize(trim(mcrypt_decrypt($cipher, $key, $encrypted, $mode, $iv)));
      }
docs: Decrypt using mcrypt
  
  @param   mixed   $data   the data to be decrypted
  @param   string  $key    the secret key
  @param   string  $cipher the cipher key
  @param   string  $mode   the mode
  @return  string