PELock.PowerShellProObfuscator 1.0.0

dotnet add package PELock.PowerShellProObfuscator --version 1.0.0
                    
NuGet\Install-Package PELock.PowerShellProObfuscator -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PELock.PowerShellProObfuscator" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PELock.PowerShellProObfuscator" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PELock.PowerShellProObfuscator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PELock.PowerShellProObfuscator --version 1.0.0
                    
#r "nuget: PELock.PowerShellProObfuscator, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PELock.PowerShellProObfuscator@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PELock.PowerShellProObfuscator&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PELock.PowerShellProObfuscator&version=1.0.0
                    
Install as a Cake Tool

PowerShell Pro Obfuscator — Obfuscate & Virtualize PowerShell Code

PowerShell Pro Obfuscator protects proprietary .ps1 scripts with renaming, polymorphic string and integer encryption, control-flow flattening, finite-state automata (FSA), a VM engine, self-defending integrity checks, a protection linker, and anti-debugging probes.

Obfuscate, virtualize & protect PowerShell .ps1 scripts with polymorphic string encryption, VM engine, finite-state automata transforms, self-integrity & anti-debugging checks — via GUI, CLI, online tool, or API.

More technical details, downloads, documentation available at:

https://www.pelock.com/products/powershell-pro-obfuscator

PowerShell Pro Obfuscator Windows Client

It's available for Windows & Linux:

Multiple programming APIs available:

An online obfuscator interface:

Why PowerShell scripts need obfuscation?

Scripts are typically distributed as plain .ps1 files or embedded in modules. That convenience means anyone with file access can read the full logic, hunt for credentials or API keys in strings, and steal your algorithms unless you take extra steps to hide intent.

PowerShell is a cross-platform shell and scripting language built on .NET. It is widely used for automation, configuration, DevOps pipelines, and endpoint management on Windows and Linux.

Obfuscation strategies

PowerShell Pro Obfuscator comes with many advanced obfuscation, virtualization & protection strategies. You can easily tune protection versus size and performance.

PowerShell Obfuscation options

Obfuscation Powerful obfuscation

PowerShell Pro Obfuscator uses state-of-the-art obfuscation strategies such as polymorphic string encryption, integers & floats encryption, and decoy noise. The result conceals literals and structure while preserving tested runtime behaviour.

Processor Code virtualization

Selected statements are lifted into a random generated VM engine opcodes with shuffled switch cases, decoy opcodes, and an obfuscated dispatcher loop. Analysts must interpret the virtual machine instead of reading plain PowerShell.

Node Finite-state automata (FSA)

Finite-state automata (FSA) obfuscation rewrites linear PowerShell statement blocks into dual-state automata with opaque schedulers and shuffled dispatch handlers. Instead of reading code top to bottom, analysts must follow numeric states, transition tables, and decoy paths to reconstruct the original order.

Bug Anti-debugging

Anti-debugging protection inserts polymorphic probes that detect attached debuggers, PowerShell breakpoints, debug preference and tracing modes, and related host signals. When a check fires, the obfuscated script exits silently instead of revealing protected logic under interactive analysis.

System monitor Self-integrity checks

A bootstrap probe verifies on-disk script shape (function counts and integrity tokens) and sets a tamper key when the file no longer matches the obfuscated build. String decryptors consume that key, so patched scripts return garbage instead of plaintext. This self-defending layer raises the cost of casual deobfuscation and file edits.

A late pass wires honeypot resolvers, bogus helper calls with random arguments, and shallow-stack tripwires that stay active only before bootstrap completes. Extracted snippets keep noisy call surfaces that look real under static review. Normal execution after a successful integrity check remains unchanged.

Before and after obfuscation

Look at this example — the same script becomes harder to read at a glance after obfuscation.

Sample PowerShell script before obfuscation

function Get-Greeting {
    param([string]$Name)
    Write-Host "Hello World from $Name!"
}
Get-Greeting "PowerShell Pro Obfuscator"

After obfuscation

$script:_HnJTskg = 0
$jwNTQ = 297 * 400 + 36
$x4e8bfda = [Math]::Abs($jwNTQ - 8074)
$_EvKocNn = [Math]::Max($jwNTQ, $x4e8bfda) - [Math]::Min($jwNTQ, $x4e8bfda)
[void]$_EvKocNn
$script:_jUoXkBYh = 0
function gnJjzMCN3V8P {
    param([int]$slot, [int]$salt, [int]$guard)
    if (-not ((Get-Variable -Name _HnJTskg -Scope Script -ErrorAction SilentlyContinue).Value)) { return '' }
    @('JFE', 'm0ao', 'R8Ysw') | ForEach-Object { $_.ToUpper() } | Out-Null
if ((((($slot * 31) + $salt) -band 65535) -ne $guard)) { return '' }
    $tk = (Get-Variable -Name _jUoXkBYh -Scope Script -ErrorAction SilentlyContinue).Value
    $IEm39CSpDOEFp = @{ 'Ouj1' = 455; 'vjzO' = 170; 'IQNV' = 291 }
$IEm39CSpDOEFp['R5LrM'] = $IEm39CSpDOEFp['Ouj1'] + $IEm39CSpDOEFp['vjzO']
$YWxSO = ($IEm39CSpDOEFp.Values | Measure-Object -Sum).Sum
[void]$YWxSO
if ($null -eq $tk) { [long]$tk = 0 }
    $v93a130f2e4 = 508
switch ($v93a130f2e4) {
    524 { $_GYF7IA14Go = 'H1Vph' }
    561 { $_GYF7IA14Go = 'HAWoB' }
    default { $_GYF7IA14Go = $v93a130f2e4 * 2 }
}
[void]$_GYF7IA14Go
$dk = (Get-Variable -Name vb6a18ffee4 -Scope Script -ErrorAction SilentlyContinue).Value
    try { $xgLN5KZyEusFo7 = [Math]::Sqrt(850) } finally { [void]$xgLN5KZyEusFo7 }
if ($null -eq $dk) { [long]$dk = 0 }
    $d = @(46866, 46865)
    if ((((-not 113))-and(([int](272 -ne 272) -eq 21)))-and(([Math]::Sign(-12) -eq 4))) { $w4iTzi2hooy1GW = @(711, 562, 665); $w4iTzi2hooy1GW = ($w4iTzi2hooy1GW | Measure-Object -Sum).Sum }
$r = ''
    for ($s9qOSpiZzufQlVyV = 0; $s9qOSpiZzufQlVyV -lt $d.Length; $s9qOSpiZzufQlVyV++) {
        [long]$v = [long]$d[$s9qOSpiZzufQlVyV]
        for ($jL9gL7PEtQeIS = 2; $jL9gL7PEtQeIS -ge 0; $jL9gL7PEtQeIS--) {
            for ($PsbomDHxAy = 2; $PsbomDHxAy -ge 0; $PsbomDHxAy--) {
                    [long]$v = [long]$v + ([long](230))
            }
        }
        for ($zhH33vzxjIzegl9 = 0; $zhH33vzxjIzegl9 -ge 0; $zhH33vzxjIzegl9--) {
                [long]$v = [long]$v + ([long]([int]((((((236 + (-3 * $s9qOSpiZzufQlVyV) + (3 * $zhH33vzxjIzegl9))) % 256) + 256) % 256))))
                [long]$v = [long]$v -bxor ([long](53766))
        }
        [long]$v = [long]$v - ([long]($salt + $slot + $tk + $dk + 0))
        if ([long]$v -ge 0 -and [long]$v -le 0xFFFF) { $r += [char][int][long]$v }
        elseif ([long]$v -ge 0x10000 -and [long]$v -le 0x10FFFF) { $r += [System.Char]::ConvertFromUtf32([int][long]$v) }
    }
    return $r
}
and more...

Would you still recognise the original intent if you only had the obfuscated text and no prior copy of the script?

Obfuscated PowerShell script

How does PowerShell Pro Obfuscator work?

The engine parses PowerShell source into an AST tree, then applies selectable transforms: identifier renaming, control-flow flattening, finite-state automata (FSA), VM virtualization, polymorphic string and integer encryption, noise and decoy insertion, self-defending integrity probes, the protection linker, and anti-debugging checks. Many techniques are specific to this product; some ideas are shared with our other protection tools.

PowerShell Pro Obfuscator Pipeline

When all passes finish, the engine emits a new .ps1. Edge cases in the PowerShell grammar and hosting environments mean you should always test the output in your target runtime.

Protect your PowerShell scripts & algorithms

Take no chances, use PowerShell Pro Obfuscator to obfuscate, virtualize and protect your PowerShell scripts and algorithms.

Our company has a long history in obfuscation technologies and code obfuscators (see our x86 Assembly, AutoIt & Java obfuscators).

We actively bugfix, research and develop new obfuscation strategies for our tools.

You can count on our expertise and support in this field.

Installation

The preferred way of WebApi interface installation is via NuGet (targets .NET 8). Package id: PELock.PowerShellProObfuscator.

Run:

dotnet add package PELock.PowerShellProObfuscator

From Visual Studio NuGet Package Manager Console:

Install-Package PELock.PowerShellProObfuscator

Or add this entry directly to your .csproj file in ItemGroup / PackageReference:

<ItemGroup>
  <PackageReference Include="PELock.PowerShellProObfuscator" Version="1.0.0" />
</ItemGroup>

Then import the client namespace and create an instance:

using PELock.PowerShellProObfuscator;

var myPowerShellProObfuscator = new PowerShellProObfuscator("ABCD-ABCD-ABCD-ABCD");

The package listing on NuGet will be at https://www.nuget.org/packages/PELock.PowerShellProObfuscator/ after publishing. To run the included samples from this repository, use each example project alongside powershell-pro-obfuscator-example*.cs:

dotnet run --project examples/powershell-pro-obfuscator-example-simple.csproj

Example of obfuscating PowerShell script source code using default options

/******************************************************************************
 * PowerShell Pro Obfuscator WebApi interface usage example.
 *
 * In this example we will obfuscate sample source with default options.
 *
 * Version        : v1.0.0
 * Language       : C#
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

using PELock.PowerShellProObfuscator;

//
// create PowerShell Pro Obfuscator class instance (we are using our activation key)
//
var myPowerShellProObfuscator = new PowerShellProObfuscator("ABCD-ABCD-ABCD-ABCD");

//
// source code in PowerShell format
//
const string ScriptSourceCode =
    """
    function Get-Greeting {
        param([string]$Name)
        Write-Host "Hello World from $Name!"
    }
    Get-Greeting "PowerShell Pro Obfuscator"
    """;

//
// by default all obfuscation options are enabled, so we can just simply call:
//
var result = await myPowerShellProObfuscator.ObfuscateScriptSourceAsync(ScriptSourceCode);

//
// it's also possible to pass a PowerShell script file path instead of a string e.g.
//
// var result = await myPowerShellProObfuscator.ObfuscateScriptFileAsync("/path/to/project/script.ps1");

//
// result object holds the obfuscation results as well as other information
//
// result?.Error           - error code (see PowerShellProObfuscator.Error*)
// result?.Output          - obfuscated code
// result?.Demo             - was it used in demo mode (invalid or empty activation key was used)
// result?.CreditsLeft      - usage credits left after this operation
// result?.CreditsTotal     - total number of credits for this activation code
// result?.Expired          - if this was the last usage credit for the activation key it will be set to true
//
if (result is not null)
{
    //
    // display obfuscated code
    //
    if (result.Error == PowerShellProObfuscator.ErrorSuccess && result.Output is not null)
        Console.WriteLine(result.Output);
    else
        throw new InvalidOperationException("An error occurred, error code: " + result.Error);
}
else
{
    throw new InvalidOperationException("Something unexpected happen while trying to obfuscate the code.");
}

An example of obfuscating PowerShell script source code with customized obfuscation strategies

/******************************************************************************
 * PowerShell Pro Obfuscator WebApi interface usage example.
 *
 * In this example we will obfuscate sample source with custom options.
 *
 * Version        : v1.0.0
 * Language       : C#
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

using PELock.PowerShellProObfuscator;

//
// create PowerShell Pro Obfuscator class instance (we are using our activation key)
//
var myPowerShellProObfuscator = new PowerShellProObfuscator("ABCD-ABCD-ABCD-ABCD");

//
// should the source code be compressed (both input & compressed)
//
myPowerShellProObfuscator.EnableCompression = false;

//
// global obfuscation options
//
// you can disable a particular obfuscation strategy globally if it
// fails or you don't want to use it without modifying the source codes
//
// by default all obfuscation strategies are enabled
//

//
// protection against tampering with protected code (integrity verification)
//
myPowerShellProObfuscator.SelfDefending = true;

//
// protection linker (decoy call graph)
//
myPowerShellProObfuscator.ProtectionLinker = true;

//
// rename variable names to random string values
//
myPowerShellProObfuscator.RenameVariables = true;

//
// rename parameter names to random string values
//
myPowerShellProObfuscator.RenameParameters = true;

//
// rename function names to random string values
//
myPowerShellProObfuscator.RenameFunctions = true;

//
// shuffle function order in the output source
//
myPowerShellProObfuscator.ShuffleFunctions = true;

//
// change linear code execution flow via control-flow flattening
//
myPowerShellProObfuscator.ControlFlowFlatten = true;

//
// rewrite statement blocks into finite-state automata (state-machine obfuscation)
//
myPowerShellProObfuscator.StateMachine = true;

//
// lift selected statements into a VM engine (virtualized statements)
//
myPowerShellProObfuscator.VmStrategy = true;

//
// encrypt integers
//
myPowerShellProObfuscator.EncryptIntegers = true;

//
// split strings into concatenated chunks
//
myPowerShellProObfuscator.SplitStrings = true;

//
// encrypt strings using randomly generated polymorphic encryption algorithms
//
myPowerShellProObfuscator.EncryptStrings = true;

//
// move integers to arrays
//
myPowerShellProObfuscator.IntegersToArrays = true;

//
// move floats to arrays
//
myPowerShellProObfuscator.FloatsToArrays = true;

//
// insert dead code
//
myPowerShellProObfuscator.InsertDeadCode = true;

//
// replace boolean conditions with equivalent complex expressions
//
myPowerShellProObfuscator.ComplexifyBooleans = true;

//
// represent integers via floating-point math
//
myPowerShellProObfuscator.IntegersToFloating = true;

//
// encrypt floating point numbers
//
myPowerShellProObfuscator.EncryptFloating = true;

//
// insert decoy functions
//
myPowerShellProObfuscator.DecoyFunctions = true;

//
// insert anti-debugging detections
//
myPowerShellProObfuscator.DetectDebugger = true;

//
// insert fake dot-source comment markers
//
myPowerShellProObfuscator.FakeDotSourceMarkers = true;

//
// insert opaque predicate branches
//
myPowerShellProObfuscator.OpaqueBranches = true;

//
// insert scriptblock decoys
//
myPowerShellProObfuscator.ScriptblockDecoys = true;

//
// insert here-string padding
//
myPowerShellProObfuscator.LiteralPadding = true;

//
// use indirect command invocation
//
myPowerShellProObfuscator.ReflectInvokeCommands = true;

//
// store string fragments in char-code array vaults
//
myPowerShellProObfuscator.StringCharArrayVault = true;

//
// wrap code in try/finally blocks with dead noise
//
myPowerShellProObfuscator.TryFinallyNoise = true;

//
// apply redundant xor / affine integer masks
//
myPowerShellProObfuscator.AffineIntegerMask = true;

//
// insert dead event/timer stubs
//
myPowerShellProObfuscator.EventStub = true;

//
// strip comments from the output source
//
myPowerShellProObfuscator.RemoveComments = true;

//
// source code in PowerShell format
//
const string ScriptSourceCode =
    """
    function Get-Greeting {
        param([string]$Name)
        Write-Host "Hello World from $Name!"
    }
    Get-Greeting "PowerShell Pro Obfuscator"
    """;

//
// by default all obfuscation options are enabled, so we can just simply call:
//
var result = await myPowerShellProObfuscator.ObfuscateScriptSourceAsync(ScriptSourceCode);

//
// it's also possible to pass a PowerShell script file path instead of a string e.g.
//
// var result = await myPowerShellProObfuscator.ObfuscateScriptFileAsync("/path/to/project/script.ps1");

//
// result object holds the obfuscation results as well as other information
//
// result?.Error           - error code (see PowerShellProObfuscator.Error*)
// result?.Output          - obfuscated code
// result?.Demo             - was it used in demo mode (invalid or empty activation key was used)
// result?.CreditsLeft      - usage credits left after this operation
// result?.CreditsTotal     - total number of credits for this activation code
// result?.Expired          - if this was the last usage credit for the activation key it will be set to true
//
if (result is not null)
{
    //
    // display obfuscated code
    //
    if (result.Error == PowerShellProObfuscator.ErrorSuccess && result.Output is not null)
        Console.WriteLine(result.Output);
    else
        throw new InvalidOperationException("An error occurred, error code: " + result.Error);
}
else
{
    throw new InvalidOperationException("Something unexpected happen while trying to obfuscate the code.");
}

Check activation key status

/******************************************************************************
 * PowerShell Pro Obfuscator WebApi interface usage example.
 *
 * In this example we will verify our activation key status.
 *
 * Version        : v1.0.0
 * Language       : C#
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

using PELock.PowerShellProObfuscator;

//
// create PowerShell Pro Obfuscator class instance (we are using our activation key)
//
var myPowerShellProObfuscator = new PowerShellProObfuscator("ABCD-ABCD-ABCD-ABCD");

//
// login to the service
//
var result = await myPowerShellProObfuscator.LoginAsync();

//
// result object holds the information about the license
//
// result?.Demo           - is it a demo mode (invalid or empty activation key was used)
// result?.CreditsLeft    - usage credits left after this operation
// result?.CreditsTotal    - total number of credits for this activation code
// result?.StringLimit     - Max. source code size allowed (it's 1000 bytes for demo mode)
//
if (result is not null)
{
    Console.WriteLine("Demo version status - " + (result.Demo == true ? "true" : "false"));
    Console.WriteLine("Usage credits left - " + result.CreditsLeft);
    Console.WriteLine("Total usage credits - " + result.CreditsTotal);
    Console.WriteLine("Max. source code size - " + result.StringLimit);
}
else
{
    throw new InvalidOperationException("Something unexpected happen while trying to login to the service.");
}

Use PowerShell Pro Obfuscator Online

Online interface for PowerShell Pro Obfuscator is available at:

https://www.pelock.com/powershell-pro-obfuscator/

Windows GUI client and command line version

PowerShell Pro Obfuscator comes also with full GUI version for Windows:

PowerShell Pro Obfuscator Windows Client

Obfuscation options:

PowerShell Obfuscation options

Obfuscated PowerShell script:

Obfuscated PowerShell script

Download

You can download it at:

https://www.pelock.com/products/powershell-pro-obfuscator/download

Installation package contains an additional command line interface:

PowerShell Pro Obfuscator command-line interface

PowerShell Pro Obfuscator ships with a command-line interface for Windows and Linux automation.

Use it to integrate obfuscation into build servers, CI jobs, or batch packaging.

Bartosz Wójcik

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 40 7/28/2026