473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Assembly Security.

Hi,
I have a solution with 2 projects.
The first creates a DLL. the second a EXE which references the DLL.
Some classes and functions within the DLL have to be public so I can use
them in the EXE project.

How do I stop others referencing my DLL and using its public functions.

Regards
Tim
Jul 21 '05 #1
6 1434
Hi Tim,

Thanks for your post!!

Based on my understanding, you want to export several public methods from a
DLL assembly, then limit the assembly that can call these methods. If I
misunderstand you, please feel free to tell me, thanks

First, in software area, protection and crack are against with each other
for a long time, there is no complete way of preventing the software from
being cracked. This is also true for .Net. Also, because of the .Net
assembly metadata and manifest, it is even much easier for hack to do
reverse engineering with the .Net assembly. I think Reflector is a good
point for this.

Ok, let's back to our topic. For your request, I think the first step we
should do is strong name our calling exe assembly, that is because only
strong named assembly can be only identified easily, it is like that
assembly has an identity.
Then, in our dll methods, we can use Assembly.GetCallingAssembly method to
get the assembly reference that is calling our methods. With the assembly
reference, we may use Assembly.GetName().GetPublicKey() to get the strong
name pulic key of the calling assembly. Then we can do the comparison and
fail the unexpected assembly calling.

I think the article below may give you some hint:
http://blogs.msdn.com/shawnfa/archiv...26/248114.aspx

There maybe some other good ways to get this done. And other community
members may give some good advise. Thanks
================================================== ==========
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #2
Hi Tim,

Does my reply make sense to you? Is your problem resolved? Please feel free
to feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
Hi Tim,

Does my reply make sense to you? Is your problem resolved? Please feel free
to feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #4
Hi, Sorry for the delay,

It did make sense thanks, I am also experimenting with the
System.Security.Permission.StrongNameIndentityPerm ission class.

Hope to have an answer soon.

Regards Tim

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:po**************@TK2MSFTNGXA01.phx.gbl...
Hi Tim,

Does my reply make sense to you? Is your problem resolved? Please feel
free
to feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #5
Hi, Sorry for the delay,

It did make sense thanks, I am also experimenting with the
System.Security.Permission.StrongNameIndentityPerm ission class.

Hope to have an answer soon.

Regards Tim

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:po**************@TK2MSFTNGXA01.phx.gbl...
Hi Tim,

Does my reply make sense to you? Is your problem resolved? Please feel
free
to feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #6
Hi Tim,

Thanks for your feedback.

Yes, StrongNameIndentityPermissionAttribute offers our the similiar
function. For more information, please refer to:
"How to Secure Your Assemblies"
http://www.developer.com/security/print.php/3415421

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Thomas Christmann | last post by:
Hi! I have a rather special question here. I'd like to write a wrapper for a .NET assembly, and register that on my server so that the people on my server call my assembly instead of the...
3
by: Daylor | last post by:
hi. im loading assembly from my computer and createInstance from it. till now it worked ok. now, im changing the path from : c:\myfolder\myassembly.dll to
3
by: jlea | last post by:
I'm receiving the error message shown below when I try to load an aspx file (C# web application) on our server. The web application works fine if I remove the reference to the dll so I know the...
13
by: Thomas Christmann | last post by:
Hi! I have a rather special question here. I'd like to write a wrapper for a .NET assembly, and register that on my server so that the people on my server call my assembly instead of the...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.