Feature as an External Encrypted File
This example delivers a premium feature as encrypted code that ships separately from the
application, unlocked only when the customer also has a license that grants it. Babel Obfuscator can
strip the encrypted body of a method into an external .eil file instead of embedding it. At runtime
the Babel Virtual Machine asks the application for that file (get stream) and for its password
(get password). This example gates both hooks on a valid Babel Licensing license, so unlocking
the premium feature requires two things at once: the premium.eil file deployed next to the app, and
a signed, hardware-locked license that grants the feature.
To use this example you need a site license for Babel Obfuscator (Ultimate, Server or Data Center editions) and Babel Licensing. The source code is available on GitHub:
git clone https://github.com/babelfornet/external-encrypted-code-console-example.gitBecause the feature source is set but internal is not, Babel emits the encrypted body to
premium.eil instead of embedding it:
[Obfuscation(Feature = "msil encryption:source=premium;password=...")] // no internal -> external .eil
public string Analyze(string data) { /* premium body, stripped to premium.eil */ }
[Obfuscation(Feature = "msil encryption get stream")] // returns the premium.eil stream (license-gated)
[Obfuscation(Feature = "msil encryption get password")] // returns the password (license-gated)The project copies premium.eil from the build’s intermediate folder to the output with a small
AfterTargets="Build" MSBuild target, so it can be deployed — or deliberately withheld to sell the
feature separately.
Standard license, no premium.eil -> Premium blocked
Premium license, no premium.eil -> Premium blocked (feature not delivered)
Standard license, premium.eil -> Premium blocked (not licensed)
Premium license + premium.eil -> Premium analysis runsSee External Code Files in the Code Encryption
manual for more on the .eil mechanism.