Introduction
Resource Encryption in PreEmptive Protection™ Dotfuscator™ encrypts resources packaged in an app or library, making it more difficult to copy or alter them. During the build, Dotfuscator encrypts the resources and injects code to decrypt them at runtime. We currently support encrypting both embedded and satellite resources.
Limitations
Resource encryption is currently not supported with Mac Catalyst ARM64 assemblies.
Implementing Resource Encryption
Create a console project in the .NET 5+ framework with resources. Build it in release mode. Upon successfull completion of the build process, proceed with the following steps:
-
Open Dotfuscator.
-
Ensure Resource Encryption is enabled:
Navigate to the settings and modify the "Disable Resource Encryption" option to "No" to enable encryption.
-
Input Resource Files:
Upload the desired.dll
file containing the resources you wish to encrypt. -
Select Resources for Encryption:
Head to the resource encryption tab and visually select the resources you want to encrypt.
-
Initiate Build Process:
Click on the build button to start the encryption process. -
Verify Encrypted Resources:
Navigate to the Dotfuscated folder and open the.dll
file using ILSpy or similar tool. You'll be able to observe the encrypted resources.
Encrypting Satellite Assemblies
Create a console project in the .NET 5+ framework with satellite assemblies. Upong successful completion of the build process, proceed with the following steps:
Here is the link on How to create satellite resources:
-
Open Dotfuscator.
-
Ensure Resource Encryption is enabled:
Navigate to the settings and modify the "Disable Resource Encryption" option to "No" to enable encryption.
-
Input Resource Files:
Upload the desired.dll
file containing the resources intended for encryption. -
Select Resources for Encryption:
Move to the resource encryption tab and visually select all resources you wish to encrypt.
-
Initiate Build Process:
Click on the build button to commence the encryption process. -
Verify Encrypted Resources:
Navigate to the Dotfuscated folder and open the.dll
file using ILSpy to view the encrypted resources. -
Confirm Encrypted Resources in Culture Folder:
Navigate to the Culture subdirectory within the Dotfuscated directory and open the.dll
file using ILSpy. Note that the encrypted resources maintain the same names as the main assembly(.dll)
.