Subscription License with Encrypted Pro Code
This example shows a time-limited (subscription) license with a grace period, where the subscription-only functionality is protected with Babel Obfuscator MSIL Code Encryption. The pro code can only run while the subscription — including its grace window — is valid, because the Babel Virtual Machine gets the decryption password from the license itself. Once the subscription lapses past the grace period the license no longer validates, so the encrypted pro code stops running.
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/subscription-license-console-example.gitThe license carries two dates: an engine-enforced ExpireDate set to the end of the grace period
(the hard cutoff), and a soft subscription-end field marking when renewal is due. Between those
two dates the app keeps working but reminds the user to renew; after the hard cutoff the license no
longer validates and the encrypted pro code is locked.
Active -> Pro forecast runs
Grace (lapsed) -> Pro forecast runs + "please renew" warning
Expired (>grace) -> Pro forecast locked (BVM cannot decrypt it)The pro method is encrypted and gets its password from the license through a get password hook:
[Obfuscation(Feature = "msil encryption:internal=true;source=pro;password=...")]
public static double Forecast(double[] history) { /* protected body */ }A companion LicenseGenerator project mints subscription licenses (--days, --grace, --expired)
so you can try each state. Because the protection is cryptographic, extending the subscription by
patching a date check does not help — without a valid license there is no password, and the pro code
cannot be decrypted.