<?php class Esempio{ public $algo = 'sha512'; public $cipher = MCRYPT_RIJNDAEL_128; public $mode = MCRYPT_MODE_CBC; public $iv = MCRYPT_RAND; public $ot = 0;
public function __construct($str, $class){ $this->$mcrypt = $class; $this->iv_size = mcrypt_get_iv_size($this->mcrypt->cipher, $this->mcrypt->mode); $this->key = $this->key($str); }
}
$mcrypt = new mcrypt('!!salt!!', new Esempio); $encrypt = $mcrypt->encrypt('sak32009'); $decrypt = $mcrypt->decrypt($encrypt); echo "$decrypt"; ?>
In questo modo l'erroe è diventato: Fatal error: Class 'mcrypt' not found