These samples show dotNet Protector activation mechanisms.
An archive containing solutions is available here
How it works
When you enable hardware lock, every method body is encrypted, but the decryption key isn’t stored into the protected assembly. dotNet Protector’s runtime needs a license key to decrypt method bodies.
Hardware locking-unlocking is a 3 steps process:
1. You protect your assembly with hardware loc enabled. Bodies are encrypted, only your public key is stored in the protected assembly – no decryption key.
2. Your activation assistant, protected with dotNet Protector builds a ‘hardware configuration’ from the hardware where it runs. This ‘hardware configuration’ is encrypted with your public key (stored by dotNet Protector into your assistant).
3. Your license generator (activation server) decrypts the ‘hardware config’ and builds a license key. The license generator runs on your side, and embeds your private key, allowing ‘hardware config’ decryption and license key encryption.
When your assembly runs, dotNet Protector Runtime looks for the license key, decrypts it with your public key and tries to decrypt bodies.
The public/private key pairs.
dotNet Protector stores symmetric and public/private key pairs (there are more than one) in a key set. The keyset is built the first time you run dotNet Protector, with help from a cryptographic random generator (there is minimal likelihood the same keyset is produced twice).
Since pki is strongly involved in activation process, this is mandatory that your assembly and your activation assistant are protected with the same keyset. Your license generator will use the private part of this keyset to build licenses.
Component (Dll) licensing
dotNet Protector® offers 2 modes for component licensing
Activate to Run : In this mode, a license is mandatory each time the dll runs. You sell your Dll in a royalty model: every final user needs a license to use it.
Activate to Reference : In this mode, a license is needed only when compiling the client application (this is the design-time license). A run-time license is generated from the design-time license when your dll runs. You sell your dll in a ‘royalty free’ model. A license is needed to consume your dll, but can be deployed with a client application.
The 3rd choice in dotNet Protector is in fact only a hybrid mode: If your dll is consumed by a windows application, it works in ‘activate to reference’ mode, when consumed by a ASPNET application, it runs in ‘activate to run’ mode.
Program Activation, activation wizard, key generation
Using a pre-activated usb stick as a dungle
Activating dlls, component licensing