473,657 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hi Richard Blewett, regarding the CAS post earlier on!

Hi there,

Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.

Oh i didn't know you can set off the security in CAS.

Sigh!

on install you could have an encrypted value accessible somewhere that said
what kind of version it was
--> Do you think you can elaborate more on this? You mean during deployment
of my dll to another machine, and check the version? So if i do this, no more
CAS attributes anymore in my codes?

I am interested to know more.

I thought CAS is everything to my solution, now sad... had to re-think!

Thanks.
--
Regards,
Chua Wen Ching :)
Nov 16 '05 #1
5 1318
Oh ya 1 more thing to confirm, with what you replied earlier.

Are you sure caspol can switch off this:

Master.dll (different master.dll for different clients that needs different
requirements) which communicates with a dongle (some security mechanism here)
--> communicates --> MyFramework.dll (which had CAS in each methods)

example:

[some mechanism, that if you use this assembly with the right GUID]
public void FuncA();

If the master.dll was found to a different version or GUID, then will reject
this function.

Caspol can remove this? Or it removes off the security policy set on the
..NET assemblies?

I need to double confirm with you.
"Chua Wen Ching" wrote:
Hi there,

Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.

Oh i didn't know you can set off the security in CAS.

Sigh!

on install you could have an encrypted value accessible somewhere that said
what kind of version it was
--> Do you think you can elaborate more on this? You mean during deployment
of my dll to another machine, and check the version? So if i do this, no more
CAS attributes anymore in my codes?

I am interested to know more.

I thought CAS is everything to my solution, now sad... had to re-think!

Thanks.
--
Regards,
Chua Wen Ching :)

Nov 16 '05 #2
If

[some mechanism, that if you use this assembly with the right GUID]

means a custom CAS permission, then yes caspol -S off will disable the check.

if it means you perform some check in code that is not CAS based then no it will not

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<54************ *************** *******@microso ft.com>

Oh ya 1 more thing to confirm, with what you replied earlier.

Are you sure caspol can switch off this:

Master.dll (different master.dll for different clients that needs different
requirements) which communicates with a dongle (some security mechanism here)
--> communicates --> MyFramework.dll (which had CAS in each methods)

example:

[some mechanism, that if you use this assembly with the right GUID]
public void FuncA();

If the master.dll was found to a different version or GUID, then will reject
this function.

Caspol can remove this? Or it removes off the security policy set on the
.NET assemblies?

I need to double confirm with you.
"Chua Wen Ching" wrote:
Hi there,

Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.

Oh i didn't know you can set off the security in CAS.

Sigh!

on install you could have an encrypted value accessible somewhere that said
what kind of version it was
--> Do you think you can elaborate more on this? You mean during deployment
of my dll to another machine, and check the version? So if i do this, no more
CAS attributes anymore in my codes?

I am interested to know more.

I thought CAS is everything to my solution, now sad... had to re-think!

Thanks.
--
Regards,
Chua Wen Ching :)


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.publi c.dotnet.langua ges.csharp]
Nov 16 '05 #3
OK, heres a mechanism using public/private key encryption:

Give people a licence number when they purchase the library that encodes whether the version is academic or professional

Have your code look for the existance of a value in the registry that has been encrypted with your private key. If the value does not exist or, upon decytpion with the public key (which you put in your code) the value is incorrect, limit the code to the 3 functions. If it is correct enable all 10 functions.

Have an activation application where they are allowed to activate the library. This calls a web service which has access to your private key, passing the license number. If the installation is for a professional version the web service returns the encrypted value which gets stored in the registry.

Its not foolproof, its still possible to crack the app by decompiling, removing the registry check and recompiling, so strong naming etc will be another line of defence ...but that can be removed with enough time and know how.

Essentially you hhve to make it more expensive to crack than the difference in buying the professional version in the first place.

The last issue is it means that the professional version won't work fully unless the user has access to the internet - for business applications this is not generally an issue but it depends on your application and customers

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<54************ *************** *******@microso ft.com>

Oh ya 1 more thing to confirm, with what you replied earlier.

Are you sure caspol can switch off this:

Master.dll (different master.dll for different clients that needs different
requirements) which communicates with a dongle (some security mechanism here)
--> communicates --> MyFramework.dll (which had CAS in each methods)

example:

[some mechanism, that if you use this assembly with the right GUID]
public void FuncA();

If the master.dll was found to a different version or GUID, then will reject
this function.

Caspol can remove this? Or it removes off the security policy set on the
.NET assemblies?

I need to double confirm with you.
"Chua Wen Ching" wrote:
Hi there,

Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.

Oh i didn't know you can set off the security in CAS.

Sigh!

on install you could have an encrypted value accessible somewhere that said
what kind of version it was
--> Do you think you can elaborate more on this? You mean during deployment
of my dll to another machine, and check the version? So if i do this, no more
CAS attributes anymore in my codes?

I am interested to know more.

I thought CAS is everything to my solution, now sad... had to re-think!

Thanks.
--
Regards,
Chua Wen Ching :)


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.publi c.dotnet.langua ges.csharp]
Nov 16 '05 #4
Hi Richard again,

I just want to confirm.

1)

[some mechanism, that if you use this assembly with the right GUID]
means a custom CAS permission, then yes caspol -S off will disable the check.
if it means you perform some check in code that is not CAS based then no it
will not
--> perform some check in the code, you mean using my custom made
attributes, and caspol tool will not work anymore? Is it wise to write my
custom security attributes?

2)

Have your code look for the existance of a value in the registry that has
been encrypted with your private key. If the value does not exist or, upon
decytpion with the public key (which you put in your code) the value is
incorrect, limit the code to the 3 functions. If it is correct enable all 10
functions.
--> Doesn't this after all, had to use CAS. If not how to do i disable all
the 7 functions if the value is incorrect! Can't caspol disable the security
set within the .dll?

3)

Have an activation application where they are allowed to activate the
library. This calls a web service which has access to your private key,
passing the license number. If the installation is for a professional version
the web service returns the encrypted value which gets stored in the registry.
--> Rather than use internet, why can't i use dongle? You know the USB
device that you can plug into the computer to check the validity of the dll
license. No need internet at all!

4)

Its not foolproof, its still possible to crack the app by decompiling,
removing the registry check and recompiling, so strong naming etc will be
another line of defence ...but that can be removed with enough time and know
how.
--> Yes i heard of this way, but by using strong names can prevent it. But
you say strong names can be removed. Can you teach me how?

5)

Do you have an email or msn which i can contact you?

*I am planning to write an article on this CAS, from what i learn and use
for my work. Will be useful for people in future.

Thanks again.

Regards,
Chua Wen Ching

"Richard Blewett [DevelopMentor]" wrote:
OK, heres a mechanism using public/private key encryption:

Give people a licence number when they purchase the library that encodes whether the version is academic or professional

Have your code look for the existance of a value in the registry that has been encrypted with your private key. If the value does not exist or, upon decytpion with the public key (which you put in your code) the value is incorrect, limit the code to the 3 functions. If it is correct enable all 10 functions.

Have an activation application where they are allowed to activate the library. This calls a web service which has access to your private key, passing the license number. If the installation is for a professional version the web service returns the encrypted value which gets stored in the registry.

Its not foolproof, its still possible to crack the app by decompiling, removing the registry check and recompiling, so strong naming etc will be another line of defence ...but that can be removed with enough time and know how.

Essentially you hhve to make it more expensive to crack than the difference in buying the professional version in the first place.

The last issue is it means that the professional version won't work fully unless the user has access to the internet - for business applications this is not generally an issue but it depends on your application and customers

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<54************ *************** *******@microso ft.com>

Oh ya 1 more thing to confirm, with what you replied earlier.

Are you sure caspol can switch off this:

Master.dll (different master.dll for different clients that needs different
requirements) which communicates with a dongle (some security mechanism here)
--> communicates --> MyFramework.dll (which had CAS in each methods)

example:

[some mechanism, that if you use this assembly with the right GUID]
public void FuncA();

If the master.dll was found to a different version or GUID, then will reject
this function.

Caspol can remove this? Or it removes off the security policy set on the
.NET assemblies?

I need to double confirm with you.
"Chua Wen Ching" wrote:
> Hi there,
>
> Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.
>
> Oh i didn't know you can set off the security in CAS.
>
> Sigh!
>
> on install you could have an encrypted value accessible somewhere that said
> what kind of version it was
> --> Do you think you can elaborate more on this? You mean during deployment
> of my dll to another machine, and check the version? So if i do this, no more
> CAS attributes anymore in my codes?
>
> I am interested to know more.
>
> I thought CAS is everything to my solution, now sad... had to re-think!
>
> Thanks.
> --
> Regards,
> Chua Wen Ching :)


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.publi c.dotnet.langua ges.csharp]

Nov 16 '05 #5
1) I mean you have code like:

if( !professionalEn abled)

throw new LicensingExcept ion("You need to pay more money");

CAS has no concept of this and so turning it off would not stop the check working. Of course the crucial thing is how do you determine whether the professionalEna bled is set to true or not - which brings me to my next point.

2)

internal class LicenseChecker

{

public static readonly bool ProfessionalEna bled; // the readonly means that it can't be set via reflection

static LicenseChecker( )

{

// check the registry for an encrypted value

// Decrypt with the public key

if( regValue == "pro" ) // check the decrypted value

{

ProfessionalEna bled = true;

}

}

public void ProfessioanlOnl yFunction()

{

if( !LicenseChecker .ProfessionalEn abled )

throw new LicenseExceptio n();

...

}

}

3) Yes, I guess a dongle would work, but while you give people the pieces of the security infrastructure, the easier it is for them to work out a way round - whatever algorithms, etc are necessary to make your checks work are available to the client who has enough time and expertise. If that code is on another machine that you control, they can't examine the algorithms> If you don't want someone to reverse engineer your code the only thing you can do is not give them your code at the end of the day.

4) Say you have a strong named assembly Foo.dll. Hack it with a Binary Editor. Now run

sn -Vr foo.dll

you've now switched off verification checking (the process by which the assembly loader checks to see whether a an assembly has been tampered with) for that assembly on this machine.

5) richardb AT NOSPAM develop DOT com

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<DA************ *************** *******@microso ft.com>

Hi Richard again,

I just want to confirm.

1)

[some mechanism, that if you use this assembly with the right GUID]
means a custom CAS permission, then yes caspol -S off will disable the check.
if it means you perform some check in code that is not CAS based then no it
will not
--> perform some check in the code, you mean using my custom made
attributes, and caspol tool will not work anymore? Is it wise to write my
custom security attributes?

2)

Have your code look for the existance of a value in the registry that has
been encrypted with your private key. If the value does not exist or, upon
decytpion with the public key (which you put in your code) the value is
incorrect, limit the code to the 3 functions. If it is correct enable all 10
functions.
--> Doesn't this after all, had to use CAS. If not how to do i disable all
the 7 functions if the value is incorrect! Can't caspol disable the security
set within the .dll?

3)

Have an activation application where they are allowed to activate the
library. This calls a web service which has access to your private key,
passing the license number. If the installation is for a professional version
the web service returns the encrypted value which gets stored in the registry.
--> Rather than use internet, why can't i use dongle? You know the USB
device that you can plug into the computer to check the validity of the dll
license. No need internet at all!

4)

Its not foolproof, its still possible to crack the app by decompiling,
removing the registry check and recompiling, so strong naming etc will be
another line of defence ...but that can be removed with enough time and know
how.
--> Yes i heard of this way, but by using strong names can prevent it. But
you say strong names can be removed. Can you teach me how?

5)

Do you have an email or msn which i can contact you?

*I am planning to write an article on this CAS, from what i learn and use
for my work. Will be useful for people in future.

Thanks again.

Regards,
Chua Wen Ching

"Richard Blewett [DevelopMentor]" wrote:
OK, heres a mechanism using public/private key encryption:

Give people a licence number when they purchase the library that encodes whether the version is academic or professional

Have your code look for the existance of a value in the registry that has been encrypted with your private key. If the value does not exist or, upon decytpion with the public key (which you put in your code) the value is incorrect, limit the code to the 3 functions. If it is correct enable all 10 functions.

Have an activation application where they are allowed to activate the library. This calls a web service which has access to your private key, passing the license number. If the installation is for a professional version the web service returns the encrypted value which gets stored in the registry.

Its not foolproof, its still possible to crack the app by decompiling, removing the registry check and recompiling, so strong naming etc will be another line of defence ...but that can be removed with enough time and know how.

Essentially you hhve to make it more expensive to crack than the difference in buying the professional version in the first place.

The last issue is it means that the professional version won't work fully unless the user has access to the internet - for business applications this is not generally an issue but it depends on your application and customers

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<54************ *************** *******@microso ft.com>

Oh ya 1 more thing to confirm, with what you replied earlier.

Are you sure caspol can switch off this:

Master.dll (different master.dll for different clients that needs different
requirements) which communicates with a dongle (some security mechanism here)
--> communicates --> MyFramework.dll (which had CAS in each methods)

example:

[some mechanism, that if you use this assembly with the right GUID]
public void FuncA();

If the master.dll was found to a different version or GUID, then will reject
this function.

Caspol can remove this? Or it removes off the security policy set on the
.NET assemblies?

I need to double confirm with you.
"Chua Wen Ching" wrote:
Hi there,

Sorry for the late reply. I was busy attending Microsoft Teched 2004 Malaysia.

Oh i didn't know you can set off the security in CAS.

Sigh!

on install you could have an encrypted value accessible somewhere that said
what kind of version it was
--> Do you think you can elaborate more on this? You mean during deployment
of my dll to another machine, and check the version? So if i do this, no more
CAS attributes anymore in my codes?

I am interested to know more.

I thought CAS is everything to my solution, now sad... had to re-think!

Thanks.
--
Regards,
Chua Wen Ching :)


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.publi c.dotnet.langua ges.csharp]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.publi c.dotnet.langua ges.csharp]
Nov 16 '05 #6

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

Similar topics

8
5240
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
14
1391
by: invincible | last post by:
Hi I want to find an algorithim , which calculates shortest perpendicular distance from a given point to a line. Thanks Mohan
77
3998
by: M.B | last post by:
Guys, Need some of your opinion on an oft beaten track We have an option of using "goto" in C language, but most testbooks (even K&R) advice against use of it. My personal experience was that goto sometimes makes program some more cleaner and easy to understand and also quite useful (in error handling cases). So why goto is outlawed from civilized c programmers community. is there any technical inefficiency in that.
7
2203
by: Mrinal Kamboj | last post by:
Hi , I am using OracleConnection object from Oracle ODP.net provider and following is the behaviour which i am finding bit strange : To start with my argument is based on followings facts : 1. Connection object is a reference type object . 2. All reference types are passed by reference even when done without using modifier like ref / out .
8
1350
by: shyam | last post by:
Hi All As per my understanding we use xs:key when we want to have a unique value for a element or attribute and keyref to refer to one of the unique values of that element or attribute. However I am not sure if this uniqueness is checked when we validate a document using XMLSpy Here is the protion of myschema
12
6602
by: whitehatmiracle | last post by:
Dear Sir I couldnt quite figure out wat your permute function does exactly... could you please throw some light on it? void Permute(char *Perm, size_t n, size_t unchanged) { size_t outer = 0; size_t inner = 0; int temp = 0;
10
1499
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3... fred will appear as the Name of Button1, however, the handler for Button1 works still works as well... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
4
1899
by: mpatharkar | last post by:
Hi all, I wrote a script to search a pattern in input file and if pattern does not found in input file ,print that pattern in to output file. The input file is -------------------------------------------------------- 1999-1011»All the flowers of tomorrow are in the seeds of today. 2000-1209»I saw this article posted on another site and wanted to share it with everyone at TSDN. Please read this article and post your thoughts....
5
1580
by: Philip Potter | last post by:
I have a somewhat flippant question regarding undefined behaviour. Does an operation which invokes undefined behaviour affect the whole program, or are earlier statements guaranteed to execute correctly? For example: #include <stdio.h> int main(void) { int i;
0
8302
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.