protected function _random($bytes) {
		if (is_readable('/dev/urandom')) {
			$stream = fopen('/dev/urandom', 'rb');
			$result = fread($stream, $bytes);

			fclose($stream);
			return $result;
		}
		if (function_exists('mcrypt_create_iv')) {
			return mcrypt_create_iv($bytes, MCRYPT_DEV_RANDOM);
		}
		throw new Exception("No source for generating a cryptographically secure seed found.");
	}