.NET String Encryptor/Obfuscator
Obfuscate C# string literals using 6 different techniques: hex escape sequences, Convert.FromBase64String decoding, XOR-encrypted byte arrays with runtime decryption, char arrays with new string(), StringBuilder split concatenation, and Unicode escape sequences. Each method generates valid C# code that produces the original string at runtime. Compare all methods side by side, filter by technique, and copy the generated code - all free, private, and no signup required.
Obfuscate C# string literals using 6 different techniques: hex escape sequences, Convert.FromBase64String, XOR-encrypted byte arrays, char arrays with new string(), StringBuilder split concatenation, and Unicode escape sequences. Each method generates valid C# code that produces the original string at runtime. Compare all methods side by side or focus on one.
Enter a C#/VB.NET string above to obfuscate it using 6 different techniques. Choose from hex escape sequences, Convert.FromBase64String, XOR encryption, char arrays, StringBuilder split concatenation, or Unicode escape sequences. Click any example below the input to get started.
Features
6 Obfuscation Methods
Choose from Hex Escapes, Base64 Decoding, XOR Encryption, Char Arrays, StringBuilder Split, and Unicode Escapes. Each generates valid C# code that produces the original string at runtime.
Side-by-Side Comparison
View all 6 methods simultaneously to compare code size, readability, and obfuscation strength. Filter to focus on a single method when you find one that fits.
Size Impact Analysis
Each method shows character count and size increase from the original string, helping you balance obfuscation strength against code size. Average stats across all methods included.
Example Presets
Quickly test with realistic strings: API keys, connection strings, JWT tokens, and common phrases. Instantly see how each method transforms different types of content.
Use Cases
License Keys & API Credentials
Hide hardcoded API keys, license codes, and authentication tokens in your C# applications so they are not immediately readable in decompiled assemblies.
Database Connection Strings
Obfuscate SQL connection strings containing server names, database names, and credentials to prevent easy extraction from configuration files or compiled code.
Anti-Reversing Protection
Make reverse engineering significantly harder by hiding string constants that reveal application logic, business rules, and internal behavior patterns.
Unity Game Development
Protect game logic strings, scene names, resource paths, and event identifiers in Unity games built with C# from being easily extracted with tools like ILSpy or dnSpy.
Enterprise & Proprietary Code
Safeguard proprietary algorithms by obfuscating the string literals that reveal calculation steps, configuration keys, and internal process names in enterprise .NET applications.
URL & Endpoint Protection
Disguise internal API endpoints, webhook URLs, and service addresses in your .NET code to prevent automated scraping and targeted attacks on backend services.
About .NET String Obfuscation
What Is String Obfuscation?
String obfuscation is the practice of transforming readable string literals in source code into equivalent representations that are hard for humans and automated tools to understand. Instead of writing "Hello", you might write Convert.FromBase64String("SGVsbG8=")or new string(new char[] { (char)72, (char)101, (char)108, (char)108, (char)111 }). Both produce the same string at runtime but look completely different in your source code.
How the Obfuscation Works
The .NET String Encryptor/Obfuscator applies six distinct transformation techniques.Hex escapes convert each character to its hex byte value.Base64 decoding wraps the Base64-encoded string in Convert.FromBase64String().XOR encryption XORs each byte with a random key and generates decryption code.Char arrays represent each character as an integer code point.StringBuilder splits the string into hex-encoded pieces concatenated at runtime.Unicode escapes convert each character to its \\uNNNN representation. Each technique uses randomization to produce different output on every generation.
Effectiveness in Code Protection
String obfuscation is a critical layer in protecting .NET applications because .NET assemblies are relatively easy to decompile with tools like ILSpy, dnSpy, and dotPeek. While a determined reverser can run the obfuscated code to recover the original strings, obfuscated strings make automated scanning and pattern matching significantly harder. For best results, combine string obfuscation with ConfuserEx, Obfuscar, or other .NET obfuscators that provide control flow obfuscation and name renaming.
Privacy & Security
This tool runs entirely in your browser using client-side JavaScript. Your input strings and the generated obfuscated outputs never leave your device. There are no API calls, no server-side processing, no data storage, and no tracking. The obfuscation engine uses JavaScript's built-in string and number methods for all transformations - everything is local and private.
Related Obfuscator Tools
JavaScript Number Obfuscator
Obfuscate numeric literals in JavaScript code by converting them to math expressions, hex, octal, binary, and bitwise tricks.
JavaScript All-In-One Obfuscator
Combine multiple JS obfuscation techniques - variable renaming, string encoding, dead code, numbers, and control flow.
JavaScript Variable Name Deobfuscator
Analyze obfuscated JavaScript variable, function, and class names and suggest meaningful names based on usage context.
Java Control Flow Flattener
Flatten Java control flow into a switch-based dispatcher for obfuscation. Configurable depth with size analysis.
JavaScript Domain Lock Obfuscator
Add domain-locking to your JavaScript code with runtime hostname checks, encrypted allowed domain lists, and custom blocking.
CSS Variable Name Obfuscator
Rename CSS custom properties (--variable) and update all var() references across CSS, HTML, and JS. Shows full rename mapping.
Pixel Shuffle Image Obfuscator
Scramble and descramble images using seed-based pixel permutation. Fisher-Yates shuffle with Mulberry32 PRNG, lossless PNG output.
Image Noise Layer Obfuscator
Add controlled Gaussian, Uniform, or Salt & Pepper noise to obscure image details. Seed-based deterministic reversal, adjustable intensity.
Rust Integer/Literal Obfuscator
Obfuscate Rust numeric literals using hex, octal, binary, math expressions, bitwise tricks, and arithmetic combos. Supports i32, u64, f32, usize.
.NET Integer/Number Obfuscator
Obfuscate .NET numeric literals using hex, binary, bitwise, arithmetic, Convert.ToInt32/64, type suffixes, and unchecked expressions. Supports int, long, float, decimal.
Swift String Obfuscator
Obfuscate Swift string literals using hex byte arrays, Data + Base64 encoding, XOR Data, Unicode scalars, and split concatenation. Copy generated code.
Bash Variable Name Obfuscator
Replace Bash variable names with short obfuscated names. Preserves builtins, special variables ($?, $@, $#), and environment variables (PATH, HOME). Complete mapping table.
Dart String Obfuscator
Obfuscate Dart string literals using hex escapes, String.fromCharCodes, Base64 decode, XOR encryption, split concatenation, and StringBuffer + writeCharCode calls.