Feature Based Licenses
Babel Obfuscator includes a licensing feature that allows you to generate feature-based licenses for your obfuscated code. This means that you can create licenses that unlock specific features or functionality within your application based on the license key that is provided.
One way to implement this is by using code encryption in combination with Babel Licensing. You can use Babel Obfuscator to encrypt your code and then generate a license key that unlocks specific encrypted sections of the code. This way, you can provide different license levels or feature sets based on the user's needs.
For example, suppose you have an application with three levels of functionality: Standard, Professional and Enterprise. You can use Babel Obfuscator to encrypt the Enterprise features of the application and then generate a license key that unlocks those features. You can then provide different license keys to users based on their subscription level, with each key unlocking the appropriate set of features.
To implement this, you would use Babel Licensing to generate the license keys and verify them at runtime. When the user enters a license key, your application uses Babel Licensing to validate the key and determine which features should be unlocked. The encrypted sections of the code would then be decrypted and made available to the user.
The source code of the example that demonstrates feature-based licensing with code encryption is available on GitHub
The example references the Babel Licensing NuGet package to use its features. The example code will include an implementation of the LicenseManager class, which provides methods for checking the validity of a license and the presence of specific features.
The example will also include the code to generate an XML license file that specifies the license information, such as the expiration date, licensed features, and product information.
Note that the code made available in the example to generate the license is only for demonstration purposes and must not be included in production.
Code encryption can be used to protect the code that makes up the features of a software application from being used without the proper license file. This can be achieved by encrypting the code that implements a particular feature and requiring a password to decrypt and execute the code.
The password can be obtained from a license file that is generated based on the features that the user has licensed.
Babel Obfuscator uses the Obfuscation attribute to mark the code that makes up the feature to be protected and specifies the method that should be called at runtime to retrieve the password needed to decrypt and execute the protected code. This method is typically a small function that retrieves the password from a license file or a licensing server. The password is then used by Babel Obfuscator to decrypt the protected code during runtime, ensuring that only licensed users can access the feature.
Once the example is compiled, run the obfuscation project Obfuscate.babel to protect the application features with Code Encryption.
You can start the protected application and generate a license for the three different application editions provided: Standard, Professional and Enterprise. Each edition unlocks an incremental number of features, meaning that the higher the edition you license, the more features you will be able to use within the application. So, generating a license for the Enterprise edition will unlock all the features, while generating a license for the Standard edition will only unlock a subset of the features.
The LicenseManager class will check for a valid license and the presence of the requested features. If the license is valid and the features are enabled, the application will allow the user to access those features.
Overall, using code encryption with Babel Licensing can provide a powerful way to create flexible and feature-rich applications while still protecting your code from reverse engineering and piracy.
Last updated