473,407 Members | 2,546 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,407 software developers and data experts.

GUIDs, snks, reflection and ILMerge

JT
Hi,

I am having trouble finding information about GUIDs and strong-names
and don't really know what I need. If that's too ambiguous, please
tell me where to look for info on these.

Here's what I am trying to accomplish: I need to know what assembly is
calling methods in a web service. I also use ILMerge.exe to merge my
assemblies into a single executable. One of the dlls in the executable
calls the web service. I need to enforce that only this dll makes
calls to the web service. After ILMerge, I can't use reflection to
obtain the name of the dll that calls the web service and besides
that's not quite a unique ID. The dll that calls the web service will
be distributed for use in other applications, but I need to know that
the dll I'm distributing is making the calls to the web service and not
any other assemblies.

I believe a GUID would be sufficient to identify the calling dll, but I
can't find any information that tells me how to get the GUID of this
calling assembly. After reading some help files and some posted
discussions, I now think that a strong-name will not necessarily change
when the assemblies are recompiled, but I don't know enough to know how
difficult it is to create a snk file. I also don't know if merging my
assemblies will keep me from being able to obtain either a GUID or
strong-name key of the assembly.

I'm sure there are high-level discussions out there. Can anyone point
me to an example of programmatically retrieving an assembly's GUID
and/or creating snks and programmatically retrieving the public key of
an assembly? Is there a better way for me to identify a calling
assembly after it's been merged?

Thanks,

JT

Dec 2 '06 #1
3 3755
JT,
I am not "100%" on this, but my experience with ILMerge tells me that after
a merge, you are really only dealing with *one* assembly - the result of the
merge.
So, you will likely need to look at something more along the lines of CAS
(Code Access Secrurity) to ensure that only certain classes can have access
to the WebService proxy class in your merged assy.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"JT" wrote:
Hi,

I am having trouble finding information about GUIDs and strong-names
and don't really know what I need. If that's too ambiguous, please
tell me where to look for info on these.

Here's what I am trying to accomplish: I need to know what assembly is
calling methods in a web service. I also use ILMerge.exe to merge my
assemblies into a single executable. One of the dlls in the executable
calls the web service. I need to enforce that only this dll makes
calls to the web service. After ILMerge, I can't use reflection to
obtain the name of the dll that calls the web service and besides
that's not quite a unique ID. The dll that calls the web service will
be distributed for use in other applications, but I need to know that
the dll I'm distributing is making the calls to the web service and not
any other assemblies.

I believe a GUID would be sufficient to identify the calling dll, but I
can't find any information that tells me how to get the GUID of this
calling assembly. After reading some help files and some posted
discussions, I now think that a strong-name will not necessarily change
when the assemblies are recompiled, but I don't know enough to know how
difficult it is to create a snk file. I also don't know if merging my
assemblies will keep me from being able to obtain either a GUID or
strong-name key of the assembly.

I'm sure there are high-level discussions out there. Can anyone point
me to an example of programmatically retrieving an assembly's GUID
and/or creating snks and programmatically retrieving the public key of
an assembly? Is there a better way for me to identify a calling
assembly after it's been merged?

Thanks,

JT

Dec 2 '06 #2
Hi,

You're trying to verify, on the service end, whether a particular assembly
calls into your "public" web service methods, correct?

You'd have to send more than just a GUID or public key to the server in
order to secure the app, but even any encryption scheme that you may decide
to use can be easily spoofed from the machine that's hosting the valid
assembly itself. It would just be security through obscurity on the local
machine.

You might be better off just ensuring that any calls into the web service
are validated by a key that only the client can have, regardless of the
assembly in which it is called from. This can be done using encryption and
authentication. Also, try to design your web service so that it doesn't
expose any private implementation details, wherever possible (e.g., don't
accept password parameters, disable WSDL generation)

You may also want to look into encryption using WSE to protect the web
service from external attacks.

"Encrypting SOAP Messages Using Web Services Enhancements"
http://msdn2.microsoft.com/en-us/library/ms996945.aspx

Unencrypted SOAP messages are just clear-xml, so any eavesdropping app could
easily read the messages and send them to the Web Service on behalf of your
valid assembly. Not good ;)

You could use SSL for transport-level security, for example.

To authenticate the client you can use basic or digest security in IIS or a
digital certificate, for example.

Here's a really good article on Web Service security (Written for 1.1 but it
certainly applies to 2.0 as well from what I've read):

"Chapter 12 - Building Secure Web Services"
http://msdn2.microsoft.com/en-us/library/aa302428.aspx

--
Dave Sexton

"JT" <jt@onemain.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Hi,

I am having trouble finding information about GUIDs and strong-names
and don't really know what I need. If that's too ambiguous, please
tell me where to look for info on these.

Here's what I am trying to accomplish: I need to know what assembly is
calling methods in a web service. I also use ILMerge.exe to merge my
assemblies into a single executable. One of the dlls in the executable
calls the web service. I need to enforce that only this dll makes
calls to the web service. After ILMerge, I can't use reflection to
obtain the name of the dll that calls the web service and besides
that's not quite a unique ID. The dll that calls the web service will
be distributed for use in other applications, but I need to know that
the dll I'm distributing is making the calls to the web service and not
any other assemblies.

I believe a GUID would be sufficient to identify the calling dll, but I
can't find any information that tells me how to get the GUID of this
calling assembly. After reading some help files and some posted
discussions, I now think that a strong-name will not necessarily change
when the assemblies are recompiled, but I don't know enough to know how
difficult it is to create a snk file. I also don't know if merging my
assemblies will keep me from being able to obtain either a GUID or
strong-name key of the assembly.

I'm sure there are high-level discussions out there. Can anyone point
me to an example of programmatically retrieving an assembly's GUID
and/or creating snks and programmatically retrieving the public key of
an assembly? Is there a better way for me to identify a calling
assembly after it's been merged?

Thanks,

JT

Dec 2 '06 #3
JT
Thanks for the replies, guys. I think you've given me some really good
advice and things to look into. I'll be digging into all this
tomorrow. I'm hoping WCF will make all this easier, but that's
something else I haven't looked into enough.

Thanks,

JT

Dec 2 '06 #4

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

Similar topics

3
by: Tim Marsden | last post by:
Hi, I am trying to use ILMerge to consolidate a .exe and serval .dll's into a single .exe. (VB.NET) I am using the following command. ILMerge.exe /wildcards /log:Log.txt...
1
by: Oz Sozen | last post by:
I want to use ILMerge in my project, but it requires a framework version that I cannot find the download for (2.0.7.... something). The latest I can see is 2.0.5. Does anybody know where I can find...
4
by: J.Marsch | last post by:
I notice that when I generate various guids, they appear to have a mix of upper and lowercase letters. Is the uniqueness of a guid case-sensitive? In other words, if I generate a guid, and...
1
by: vector | last post by:
I've got an application that generates GUIDs. A lot of GUIDs. Lots of GUIDs that end up in files on disk, taking up space. I'd like to continue using the Guid.NewGuid() function as my unique tag...
2
by: Howard Kaikow | last post by:
Being lazy, I sometimes copy a project to another directory, then tweak the code. A problem arises because then both projects have identical GUIDs in the .sln file, and in the assembly file. ...
0
by: Dennis | last post by:
I am trying to use ILMerge to create a single executable. Below are the DOS command lines that I am using: cd c:\program files\ilmerge ilmerge /lib:c:\programming\vs-projects\recipes\bin...
0
vikramadith
by: vikramadith | last post by:
I'm having some issues merging dlls into my exe Basically I have three VS projects, one producing an exe, and the other two producing dlls. Let us just call it MyApp.exe, Lib1.dll and Lib2.dll....
28
by: Todd Carnes | last post by:
I have read several threads regarding using ILMerge to combine all your dlls with your exe to create one single exe file....I don't get it. Why would you ever want to do this? Todd
1
by: kulabhishek | last post by:
Hi, I am using ILMerge tool to merge the all the dlls into one. In my case I do not want to include one dll into output one. But my other dlls are using the reference of that dll. How it can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...

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.