(Dec 27, 2017 06:39 PM)Cecilia Wrote: Not if you are loading it as an assembly with reflection. There are ways to make sure the original bytes are never exposed in memory.
Have a look at AppDomain.SetData/GetData.
You can store things in one assembly and retrieve them from another.
https://msdn.microsoft.com/en-us/library....110).aspx
https://msdn.microsoft.com/en-us/library....110).aspx
You can always dump memory or even just decompile the assemblies and grab what the retrieved data is supposed to be...
.NET Security is not witchcraft, it's really simple : Pattern, Attacker, Server
If you rely only on the simple [Computer-Software] pattern you loose total control of your security system : all the data is
on the customer's computer at the same time. Even the data we might not want him to own, such as algorithms, decoding
keys, credentials and other sensitive data.
The attacker needs to change the code of your program in accordance with what he understand about how to crack your application.
The attacker will inspect login routines, encryption keys, messages in the file and re-code your application so the login process will
be voided : remove the necessity of a login on a software and all it's data is freely accessible, to anyone, i.e it makes it cracked.
The key is to make our basic pattern more complexe, by adding parameters to the schema so the attacker will have to work a lot
more in order to access the data. To do this we are gonna need a [computer-software-server]pattern, a third-part place that will
run Windows and that will be able to let us run our licencing process in a locked room not accessible for attackers. A black box.
Concretely what you will do is to put sensitive code on the server such as strings containing decoding keys, static algorithms...
What you can do is also to use the server to store some needed informations for your file to run, so you can compare its MD5,
and use it's MD5 as a decoding keys. The goal is to use the server a lot, to make the server supports the file and to make the
file broken without the server.