/** * Encrypt $value using public $type method in Security class * @param string $value - Value to encrypt * @param bool $enctrypt - false: no encryption * @return string - Encoded values */ protected static function encrypt($value, $enctrypt = true) { if (is_array($value)) { $value = self::implode($value); } if ($enctrypt && function_exists('mcrypt_encrypt')) { $value = self::$encryptionPrefix . base64_encode(Crypt::cookie_encrypt($value, self::getEncryptionKey())); } return $value; }