473,585 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Securing assembly question

Hi,

My main application is calling a couple of dll assembly that we made. I
want to secure those dll assembly so they can't be used by a third party.

I did a couple of test with
[assembly: AssemblyKeyFile (@"..\..\myKey. snk")] on both side, caller and
dll assembly, but does not succeed to secure the assembly. (myKey.snk is
gnerated with 'sn -k myKey.snk')

and I've read this article
http://www.morganskinner.com/Article...ityPermission/
and in this case we paste the key in the code of the dll assembly like this:
[StrongNameIdent ityPermission ( SecurityAction. Demand ,
PublicKey="0024 000004800000940 0000006020000" +

"..." +
"1c6056092c2ac4 8a8b27c53631f7d 5b6")]

But what happen when this key has to change in 50 dlls, can it be taken
from a file?

So I would liks to know what is the best way to secure the dll assembly?

Thanks
Marty
Nov 25 '05 #1
3 1416
"Marty" <xm******@hotma il.com> wrote in message
news:TMHhf.1700 20$Io.44557@clg rps13...
Hi,

My main application is calling a couple of dll assembly that we made. I
want to secure those dll assembly so they can't be used by a third party.
StrongNameIdent ityPermission verifications are quite trivial to bypass by
code with certain "high privilege" CAS permissions. In addition, all code
running with unrestricted CAS permissions (aka "full trust") automatically
passes demands for any identity permission in v. 2.0. Given this, you might
want to consider using some alternate mechanism (e.g.: licensing) for
limiting the callers into your assemblies.

I did a couple of test with
[assembly: AssemblyKeyFile (@"..\..\myKey. snk")] on both side, caller and
dll assembly, but does not succeed to secure the assembly. (myKey.snk is
gnerated with 'sn -k myKey.snk')
Exactly what were you hoping that simply signing the assembly would
accomplish with respect to "securing the assembly"?
and I've read this article
http://www.morganskinner.com/Article...ityPermission/
and in this case we paste the key in the code of the dll assembly like
this:
[StrongNameIdent ityPermission ( SecurityAction. Demand ,
PublicKey="0024 000004800000940 0000006020000" +
"..." +
"1c6056092c2ac4 8a8b27c53631f7d 5b6")]

But what happen when this key has to change in 50 dlls, can it be taken
from a file?
Yes. The value can be supplied via a constant, and that constant can be
defined in a file linked into your project.


So I would liks to know what is the best way to secure the dll assembly?

Thanks
Marty

Nov 28 '05 #2
Hi Nicole,

Thank you for your reply, this is pretty interesting.

Your suggestions about the "Licensing" is interesting and I've found an
article about it: http://windowsforms.net/articles/Licensing.aspx

Do you have other great articles about it?

I can see that licensing must be aplied to each class and forms. is
there a way to apply licensing to a whole project, such as a dll project?

Regards,
Marty

Nicole Calinoiu wrote:
"Marty" <xm******@hotma il.com> wrote in message
news:TMHhf.1700 20$Io.44557@clg rps13...
Hi,

My main application is calling a couple of dll assembly that we made. I
want to secure those dll assembly so they can't be used by a third party.

StrongNameIdent ityPermission verifications are quite trivial to bypass by
code with certain "high privilege" CAS permissions. In addition, all code
running with unrestricted CAS permissions (aka "full trust") automatically
passes demands for any identity permission in v. 2.0. Given this, you might
want to consider using some alternate mechanism (e.g.: licensing) for
limiting the callers into your assemblies.
I did a couple of test with
[assembly: AssemblyKeyFile (@"..\..\myKey. snk")] on both side, caller and
dll assembly, but does not succeed to secure the assembly. (myKey.snk is
gnerated with 'sn -k myKey.snk')

Exactly what were you hoping that simply signing the assembly would
accomplish with respect to "securing the assembly"?

and I've read this article
http://www.morganskinner.com/Article...ityPermission/
and in this case we paste the key in the code of the dll assembly like
this:
[StrongNameIdent ityPermission ( SecurityAction. Demand ,
PublicKey="00 240000048000009 400000006020000 " +
"..." +
"1c6056092c2a c48a8b27c53631f 7d5b6")]

But what happen when this key has to change in 50 dlls, can it be taken
from a file?

Yes. The value can be supplied via a constant, and that constant can be
defined in a file linked into your project.
So I would liks to know what is the best way to secure the dll assembly?

Thanks
Marty


Nov 30 '05 #3
"Marty" <xm******@hotma il.com> wrote in message
news:hMjjf.1329 48$y_1.35447@ed tnps89...
Hi Nicole,

Thank you for your reply, this is pretty interesting.

Your suggestions about the "Licensing" is interesting and I've found an
article about it: http://windowsforms.net/articles/Licensing.aspx

Do you have other great articles about it?
The one you mentioned is probably the most complete introduction I've seen.
Unfortunately, the MSDN documentation isn't likely to be much help until
you've understood the underlying mechanism and can put the specifics into
context.

I can see that licensing must be aplied to each class and forms. is there
a way to apply licensing to a whole project, such as a dll project?
AFAIK, not directly. However, you could use a post-compiler like XC#
(http://www.resolvecorp.com) to map a custom assembly-level attribute into
member-level code.

Regards,
Marty

Nicole Calinoiu wrote:
"Marty" <xm******@hotma il.com> wrote in message
news:TMHhf.1700 20$Io.44557@clg rps13...
Hi,

My main application is calling a couple of dll assembly that we made. I
want to secure those dll assembly so they can't be used by a third party.

StrongNameIdent ityPermission verifications are quite trivial to bypass by
code with certain "high privilege" CAS permissions. In addition, all
code running with unrestricted CAS permissions (aka "full trust")
automatically passes demands for any identity permission in v. 2.0.
Given this, you might want to consider using some alternate mechanism
(e.g.: licensing) for limiting the callers into your assemblies.
I did a couple of test with
[assembly: AssemblyKeyFile (@"..\..\myKey. snk")] on both side, caller and
dll assembly, but does not succeed to secure the assembly. (myKey.snk is
gnerated with 'sn -k myKey.snk')

Exactly what were you hoping that simply signing the assembly would
accomplish with respect to "securing the assembly"?

and I've read this article
http://www.morganskinner.com/Article...ityPermission/
and in this case we paste the key in the code of the dll assembly like
this:
[StrongNameIdent ityPermission ( SecurityAction. Demand ,
PublicKey="0 024000004800000 940000000602000 0" +
"..." +
"1c6056092c2 ac48a8b27c53631 f7d5b6")]

But what happen when this key has to change in 50 dlls, can it be taken
from a file?

Yes. The value can be supplied via a constant, and that constant can be
defined in a file linked into your project.
So I would liks to know what is the best way to secure the dll assembly?

Thanks
Marty



Nov 30 '05 #4

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

Similar topics

11
3421
by: Wm. Scott Miller | last post by:
Hello all! We are building applications here and have hashing algorithms to secure secrets (e.g passwords) by producing one way hashes. Now, I've read alot and I've followed most of the advice that made sense. One comment I've seen alot about is "securing the hashing routine" but no-one explains how to accomplish this. So how do I secure...
3
1489
by: archsg | last post by:
Hello, I have an ASP.Net 1.1 application that I need to move to a production server on a customer's network. I do not want the customer to have access to any code. It looks like VS2003 does not allow for precompiling code like you can do with VS2005 and 2.0. Is this correct? If so, is there any way to encrypt or hide the code so that...
10
409
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Thank you for that. It was very clear and I actually understand it!
10
3346
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Not sure if I quite follow that. 1. Data encrypted by AES key 2. AES key encrypted with Asymmetric public key (?)
0
8195
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7947
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5707
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3831
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3856
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2340
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1444
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.