HOME |
DOWNLOADS |

Prevent de-compilation
with AssemblyLockbox
Providing protection from disassembly of .Net DLL
files without introducing a burden on the software developers and without
introducing software bugs by modifying source code.
Applications written in Microsoft’s .Net technology are
extremely powerful and flexible. Reflection is one of the more powerful tools
in the .Net toolbox. This technology allows .Net software to be inspected for
details about how that software works so that interaction with that software
can be automated. This provides many interesting possibilities such as on the
fly software generation and execution, automatic proxy generation for calling
remote functions such as remoting objects or web services, and late-bound
method invocation of objects unknown at compile time. The side effect of this
technology is that it allows so much detailed information to be inspected that
the software can easily be reverse engineered otherwise known as software
de-compilation. Though any software can be reverse engineered with enough
effort and or enough access, never before has it been so easy to accomplish
this task. There are several freely available .Net de-compilers that require no
more than a path to the DLL file. With
this information alone, they can instantly return the full source code of the
contents of that DLL file.
The possible problems with this
ability to de-compile .Net application files can be serious. If you ship your
software out into the world where competitors can get their hands on it or even
only use it in-house where disgruntled employees or corporate espionage might
occur, your intellectual property can be at risk. There are other risks beyond
loss of intellectual property however. Encoded in these software files often
are the exact methods for accessing any systems that the software is suppose to
talk to whether it is server software, databases, user accounts, network ports,
method interfaces, etc. This all can be very valuable information to a hacker
trying to understand your system or a virus that de-compiles your .Net software
and sends the details home to the virus author to analyze at their leisure.
AssemblyLockbox provides a method to prevent this de-compilation
of DLL files without hampering the ability to use reflection in your applications[1].
How AssemblyLockbox fits
into your business
|
Overview |
|
AssemblyLockbox
includes components that are used by your software development team and
shipped with your software. The files shipped with your software must simply
be present in the same path as your application to work. They do not require
their own installation process. An application called AssemblyLockboxBuilder
comes with AssemblyLockbox. This application is used by software developers
to integrate AssemblyLockbox with your software and automate the process of
preparing the protected files for shipment or distribution to a web server.
·
Software developer(s)
create a .Net application. ·
Reference to
AssemblyLockbox library is added to application. ·
A call is made to the
AssemblyLockbox library to add references to your DLLs that are encrypted
with AssemblyLockbox. ·
Encrypt all your DLLs
that you want protected. ·
Replace your DLLs with
the encrypted versions. ·
Ship your software with
AssemblyLockbox.dll and your lock core dll(s)[2].
|
|
AssemblyLockbox at runtime |
|
When your DLLs are
protected by AssemblyLockbox they cannot be de-compiled. How is this? This is
possible because your entire DLL is encrypted into a file that no longer
exposes the meta data needed to use reflection to inspect the file. This
means even .Net itself can no longer load your library. This is why you must
reference AssemblyLockbox.dll in your application. This class library waits
for .Net to fail an attempted load of your DLL and then it loads your DLL for
.Net. This is no flimsy hack into .Net. This ability is provided by .Net as
yet another of .Nets flexibility features. AssemblyLockbox cannot simply load
your DLL however. It first calls the lock core dll that you used to encrypt
your DLL(s) to decrypt the DLL and then loads the library into .Nets runtime.
Just like with locks sold at hardware stores you can create different types
of “cores” for your locks so that there is no “universal key” that can be
used to get access to all software protected with AssemblyLockbox.
·
Your application
references AssemblyLockbox.dll which in turn hooks into the .Net runtime. ·
When the .Net runtime
fails to load your DLL AssemblyLockbox loads it instead. ·
AssemblyLockbox uses a
lock core dll to decrypt your DLL(s). ·
The ability to make
different kinds of lock core dlls increases the number of possible
combinations and adds other restrictions that a hacker must try to over come
to get at your software. |
|
Further your protection with Lock
Cores |
|
If all locks worked with a
single key then the very idea of a lock wouldn’t be very valuable. The same
applies to AssemblyLockbox lock cores. This is why a primary feature of
AssemblyLockbox is the ability to create more lock cores with varying
protection methods. The AssemblyLockbox technology also allows for more types
of variations to be added in the future as they are developed. Some of the
types of lock core variations possible are listed below… [3] ·
Re-encryption of your
DLLs on the client computer using local information such as network MAC
address or hard drive volume id. ·
Decryption only in the
presence of a USB hardware device. ·
Decryption only in the
presence of a local license file or some other kind of text file containing a
specific series of characters. ·
Decryption only if the
calling application itself possesses certain attributes. ·
Decryption only if the
calling application does not have reflection rights. ·
Decryption only upon
verification by Microsoft Digital Rights Management API. |
|
What makes the
lock cores more secure than a .Net file |
|
All of the decryption and
verification is performed inside the lock core dlls themselves. The reason
this is more secure is because these lock core dlls are unmanaged C++ files.
They contain no meta data themselves to be reflected and are compiled
directly into native executable form. This makes them very difficult to
decompile by anyone… including programmers that are good at raw assembly
language and that use memory scraping techniques to try to decipher what your
application is doing as it is running. In addition various counter measures
are used to disguise how the C++ works to help frustrate hackers that do go
so far as to attempt to reverse engineer the runtime execution of the
assembly commands. To create lock core dlls you must have VC++ installed on
your PC. AssemblyLockboxBuilder will call the VC++ compiler to create the
lock core. |
Integrating
AssemblyLockboxBuilder with Visual Studio and your application code
|
Adding
protection without adding a lot of extra work for the software developer |
|
To make it easier to
use AssemblyLockbox, integration for Visual Studio and features for
automatically updating your code that calls AssemblyLockbox.dll has been
added. AssemblyLockboxBuilder has two types of files that are associated with
it upon installation. The first has an extension of .LBS and the second has
an extension of .LCS. LBS files contain the setup information needed for one
or more of your DLLs. This includes information such as paths to your DLLs,
.Net information about your DLLs (version/full name), encryption keys, path
to lock cores, paths to code files that call AssemblyLockbox.dll, and
instructions for how to modify that code. LCS files contain all the settings
needed to reproduce a lock core that you have previously created with the
AssemblyLockboxBuilder. To add an LBS or LCS
file to a project you simply tell Visual Studio you want to add a new item to
your project and in the list of choices that Visual Studio presents you pick
either an LBS or LCS file. Then when you double click this file in your
project tree AssemblyLockboxBuilder will launch and will automatically look
for your debug/release folders so that it can put your encrypted DLLs and
their lock cores into the same folder as your application. Automatically updating your
code when you make changes to your DLLs is equally easy. When you integrate
your application with AssemblyLockbox, one of the tasks you perform is adding
a reference to the AssemblyLockbox.dll and then adding a few lines of code at
the beginning of your application. These few lines of code tell the
AssemblyLockbox.dll what DLLs you have encrypted and how you want them
loaded. If you create a new version of one of your protected DLLs
AssemblyLockboxBuilder can automatically detect this and update its internal
records about that DLL as well as go into your code file and update those
lines of code that refer to that new DLL by updating the version that is
expected to be loaded. This helps make the process of shipping your
application much easier since AssemblyLockboxBuilder attempts to detect and
automatically fix everything for you. |
[1] Because of the way .Net works internally some kinds of reflection only work with the original .Net file which AssemblyLockbox replaces. In these instances your code should be separated into protected and non-protected DLLs and AssemblyLockbox should be used only on the protected DLLs.
[2] Because each of your DLLs can be encrypted with a different lock core it is possible you will need to ship more than one lock core dll.
[3] Not all of these possibilities will be available in the initial release of AssemblyLockbox.