I want to compress and encrypt my whole application, maybe with Zip, 7z, Bz2, Tar, or any compression method, and using AES-128/256 as encryption algorithm for security purposes. Then create a launcher application which will handle the execution of the application and decryption of the archive.
I already have an idea on how to achieve it but with references/libraries only:
The application will handle the decryption of the file using #ZipLib, the password might be stored inside a SecureString
Create a new AppDomain and execute the executable from the archive without extracting it (just loading the bytecodes)
The secondary AppDomain must implement the event AssemblyResolve and whenever it needs to load an assembly; it will try to decrypt that file from within the archive.
But how about the files needed by the application such as images, embedded database(ex. SQLite), XMLs, and other external files? Is there any other way to do it?