Introduction

Welcome to Xbibz Obfuscator - The most advanced polymorphic obfuscation library for JavaScript, JSON, and CSS

Xbibz Obfuscator provides enterprise-grade code protection with multi-layer encryption and polymorphic transformations.

What is Code Obfuscation?

Code obfuscation is the process of transforming code into a form that is difficult to understand and reverse-engineer, while maintaining its original functionality. This is essential for protecting intellectual property and preventing code theft.

Key Features

Polymorphic Engine

Generates unique obfuscated output every time, making reverse engineering extremely difficult.

Multi-Layer Encryption

Advanced AES-256 encryption with multiple layers of protection for maximum security.

Anti-Debug Protection

Built-in protection against debugging tools and reverse engineering attempts.

Browser Compatibility

Full support for all modern browsers with automatic polyfills for older browsers.

High Performance

Optimized algorithms ensure fast obfuscation without compromising security.

Multiple Formats

Support for JavaScript, JSON, and CSS obfuscation with format-specific optimizations.

Installation

Get started with Xbibz Obfuscator in your project

1

CDN Installation (Recommended)

Include the library directly from CDN:

HTML
<script src="https://cdn.jsdelivr.net/npm/@xbibzlibrary/obfuscator@1.0.0/dist/xbibz-obfuscator.min.js"></script>
2

NPM Installation

Install via npm for use with build tools:

Bash
npm install @xbibzlibrary/obfuscator
3

Manual Download

Download and include the library manually:

HTML
<script src="https://www.npmjs.com/package/@xbibzlibrary/obfuscator"></script>
Make sure to include the library before your application code.

Quick Start

Start obfuscating your code in minutes

Basic Usage

JavaScript
// Initialize the obfuscator
const obfuscator = XbibzObfuscator.create({
    obfuscationLevel: 8,
    enableEncryption: true,
    enablePolymorphism: true
});

// Obfuscate JavaScript code
const originalCode = `
function helloWorld() {
    console.log("Hello, World!");
    return "Hello, World!";
}
`;

const obfuscatedCode = obfuscator.obfuscateJavaScript(originalCode);
console.log(obfuscatedCode);

Multiple Format Support

JavaScript
// Obfuscate JSON
const jsonData = {
    name: "John Doe",
    age: 30,
    email: "john@example.com"
};

const obfuscatedJSON = obfuscator.obfuscateJSON(JSON.stringify(jsonData));

// Obfuscate CSS
const cssCode = `
.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}
`;

const obfuscatedCSS = obfuscator.obfuscateCSS(cssCode);

JavaScript Obfuscation

Advanced protection for your JavaScript code

Features

Example

JavaScript - Before Obfuscation
function calculateTotal(price, quantity) {
    const taxRate = 0.1;
    const subtotal = price * quantity;
    const tax = subtotal * taxRate;
    const total = subtotal + tax;
    return total;
}

const result = calculateTotal(25, 4);
console.log("Total:", result);
JavaScript - After Obfuscation
var _0x1a2b = function() {
    var _0x3c4d = true;
    return function(_0x5e6f, _0x7g8h) {
        var _0x9i0j = _0x3c4d ? function() {
            if (_0x7g8h) {
                var _0x1k2l = _0x7g8h.apply(_0x5e6f, arguments);
                _0x7g8h = null;
                return _0x1k2l;
            }
        } : function() {};
        _0x3c4d = false;
        return _0x9i0j;
    };
}();
// ... Highly obfuscated code continues ...

API Configuration

Complete reference for configuration options

Initialization Options

Option Type Default Description
obfuscationLevel number 8 Obfuscation intensity from 1 (light) to 10 (maximum)
enablePolymorphism boolean true Enable polymorphic code generation
enableEncryption boolean true Enable AES encryption for strings and data
enableCompression boolean false Enable code compression (increases obfuscation time)
browserCompatibility boolean true Ensure compatibility with older browsers
autoPolyfills boolean true Automatically inject required polyfills
debugMode boolean false Enable debug logging and performance tracking

Method-specific Options

Option Type Default Description
controlFlow boolean true Obfuscate control flow structures
strings boolean true Encrypt string literals
variables boolean true Mangle variable names
functions boolean true Obfuscate function declarations
deadCode boolean true Inject dead code
antiDebug boolean true Add anti-debug protection
antiTamper boolean true Add anti-tamper protection

API Methods

Complete method reference for Xbibz Obfuscator

Core Methods

XbibzObfuscator.create(options)

Creates a new instance of the obfuscator with the specified options.

JavaScript
const obfuscator = XbibzObfuscator.create({
    obfuscationLevel: 8,
    enableEncryption: true
});

obfuscateJavaScript(code, options)

Obfuscates JavaScript code with the specified options.

JavaScript
const result = obfuscator.obfuscateJavaScript(code, {
    controlFlow: true,
    strings: true,
    antiDebug: true
});

obfuscateJSON(jsonString, options)

Obfuscates JSON data with structure transformation and encryption.

JavaScript
const obfuscatedJSON = obfuscator.obfuscateJSON(jsonString, {
    encryption: true,
    structureTransformation: true
});

obfuscateCSS(cssCode, options)

Obfuscates CSS code with class name mangling and property transformation.

JavaScript
const obfuscatedCSS = obfuscator.obfuscateCSS(cssCode, {
    mangleClassNames: true,
    encryptValues: true
});

Utility Methods

updateConfiguration(newOptions)

Updates the configuration of an existing obfuscator instance.

JavaScript
obfuscator.updateConfiguration({
    obfuscationLevel: 10,
    enableCompression: true
});

getConfiguration()

Returns the current configuration and statistics.

JavaScript
const config = obfuscator.getConfiguration();
console.log(config.obfuscationLevel);
console.log(config.browserInfo);

createJavaScriptVariant(code, variantId)

Creates a polymorphic variant of the code with the specified ID.

JavaScript
const variant = obfuscator.createJavaScriptVariant(code, 123);

Frequently Asked Questions

Common questions and answers about Xbibz Obfuscator

Is the obfuscated code reversible?

While no obfuscation is 100% irreversible, Xbibz Obfuscator uses multiple layers of encryption and polymorphic techniques that make reverse engineering extremely difficult and time-consuming. The level of protection can be configured based on your security requirements.

Does obfuscation affect code performance?

There is a minimal performance impact due to the additional layers of abstraction and decryption routines. However, the impact is generally negligible for most applications. You can adjust the obfuscation level to balance between security and performance.

Can I obfuscate Node.js code?

Yes! Xbibz Obfuscator works in both browser and Node.js environments. For Node.js, install via npm and import the library as a module.

How do I handle errors during obfuscation?

All methods include comprehensive error handling. Wrap your obfuscation calls in try-catch blocks to handle any potential errors gracefully.

JavaScript
try {
    const result = obfuscator.obfuscateJavaScript(code);
} catch (error) {
    console.error('Obfuscation failed:', error.message);
    // Handle error appropriately
}

Is there a size limit for code obfuscation?

There's no hardcoded limit, but very large files may take longer to process and consume more memory. For optimal performance, we recommend processing files under 1MB individually.

Can I use custom encryption keys?

Yes, you can provide custom encryption keys for additional security. Use the encryptionKey option during initialization or method calls.

JavaScript
const obfuscator = XbibzObfuscator.create({
    encryptionKey: 'my-custom-secret-key-12345'
});

Support

Get help and support for Xbibz Obfuscator

Report Issues

Found a bug or have a feature request? Open an issue on our GitHub repository with detailed information about the problem.

Documentation

Check the complete documentation for detailed API references, examples, and best practices.

Community

Join our community forum to discuss with other developers, share experiences, and get help.

For enterprise support and custom implementations, please contact our support team directly.