I'm developing an application that requires high levels of security and needs to hide certain libraries so that they cannot be detected from file scanning and such.

It isn't a virus or anything malicious but it does need to contain code that is undetectable so to speak.

I thought up a way to do this but am unsure how to complete the final step. For instance, I compiled a DLL, converted the DLL file to a base 64 Encoded String, Encrypted the String and Saved it inside of a new project as a String variable.

Now, when I compile my main application hypothetically it should Decrypt the String to base 64 encoding, decode base 64 into byte array and load the byte array as a library inside of the executable. All of this should be done in memory without file IO during run-time.

The final step of loading the library during run time from raw memory is the step where I am confused. I'm sure this has to be possible. I know that DLLImport command allows external libraries to be loaded but what about libraries built in memory. Could I cast the byte array to an interface and access the code that way?

By the way, an obfuscation program is not what I'm interested in. I already have one and it doesn't work very well. The others are way too expensive.