/** * Get Anubis object * @return Anubis */ public static function getAnubis() { if (!self::$anubis) { $cypher = new Anubis(); $cypher->setKey(self::$key, true); self::$anubis = $cypher; } return self::$anubis; }
/** * Decrypt/Encrypt method for russian cluster registration fill functionality * * @return string */ public function cipher() { $data = isset( $_POST['anubis'] ) ? $_POST['anubis'] : null ; if ( is_null( $data ) ) return false; $decodedData = base64_decode($data); $cipherKey = eZINI::instance('site.ini')->variable('SiteSettings', 'AnubisCipherKey'); $anubis = new Anubis(); $anubis->setKey($cipherKey); $decryptedData = $anubis->decrypt($decodedData); return $decryptedData; }