473,734 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to hide code in the assembly?

I wrote an assembly in C#/.NET that includes some personal information.
But this information can be revealed by opening the assembly in tools like
the ‘Microsoft .NET Framework IL DASM’ and ‘Reflector’ .
I do not want to expose this code.

How do I hide it?

--
Regards
Sharon G.
Nov 16 '05
12 4631
Ok, it's sound much better.
But can you please explain how do I do option 1 and 2?

I'll very much appreciate code sample.

Thanks
Sharon
Nov 16 '05 #11
...
MailMessage MyMail = new MailMessage();
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/smtpau
thenticate", "1");
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendus
ername", "UserName") ;
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendpa
ssword", " password");
And by using the tool I mentioned before, this user name and password
can be
seen Easley.
How can I hide this data?

Solution is simple enough.
Please, do not keep real "UserName" and "password" in your source code.
Hide username and password to database or keep them (encrypted!) in
web.config file. Then (during run time) extract user name and password
from database or web.config file, decrypt and use them in
MyMail.Fields.A dd...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #12
This kind of information shouldn't be in the assembly anyway. If it's "baked
in" then it can't ever be changed without causing your application to stop
working. One way would be to store it in the configuration file (encrypted).
A better way would be to ask the user to enter the user name and password
the first time your app starts, and then store it using DPAPI.

"Sharon" <Sh****@discuss ions.microsoft. com> wrote in message
news:FA******** *************** ***********@mic rosoft.com...
Actually by problem is a bit different then I posted.
I'm sending mail form the assembly, and for that I'm doing authentication
like that:
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1");
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendusername",
"UserName") ;
MyMail.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendpassword",
" password");

And by using the tool I mentioned before, this user name and password can
be
seen Easley.

How can I hide this data?

------
Regards
Sharon G.

Nov 16 '05 #13

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

Similar topics

10
3296
by: Ray Z | last post by:
hi, there I build a Class Library, I write a class A to implement interface IA. The problem is when I give the dll file to others, thet can get all information about not only IA, but also A. They can even see my protected members of class A. How could I hide these informations about class A, just give them the interface informations. thanks.
0
1454
by: Alex Sedow | last post by:
I have 3 projects: 1. C++ static library (.lib) with fast code. (Core level) 2. Managed C++ assembly (.dll) that include C++ library (1) and contain managed wrappers around classes from C++ library. (Wrapper level). 3. C# project that use managed C++ assembly (2). (User level) Problem consist in that C# project may see C++ classes form static library (1). For example, I may write in C# project code that dynamically (with new) create...
14
4826
by: Laurent Vigne | last post by:
Hello, I would like to know how to make the methods of an interface inaccessible from outside Example: ---------------------------------------------- internal Interface ImyInterface { void MyPrivateMethod(); // I cant define any accessibility here, well ok ! }
0
2099
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by Activator.CreateInstance, because I want it independant of the main application, as a plugin. All assembly are loaded...
3
4786
by: mfc_mobile | last post by:
Hi, I'm trying to develop a control and want to hide the base class of the control, how do i do that? I want to do something like the follow :- internal class BaseClass { }
9
3500
by: Martin Widmer | last post by:
Hello! I would like to hide one property of a base class in a derived class. How could it be done? I tried to override it with a private property, but that doesn't seem to do the hiding. Martin
3
1860
by: Nathan | last post by:
I have a .Net assembly that exposes functionality to COM through the use of a ComClass. The assembly is installed using an MSI which automatically registers the assembly for COM interop. My problem is that when a user views the assembly through object browser, the automatically generated classes connected with a web service appear.
2
8057
by: Back 9 | last post by:
Hello, In this news group I knew that Reflector for .NETis so cool. But on the other hand I want to hide my code from it. Is there any way to do that? TIA
2
1514
by: mrajanikrishna | last post by:
Hi friends, I have a web page(.aspx) in my project. In the code behind, I have a method. How can I hide(invisible) only that method and rest of the code is visible(all other button events, bla bla). That means when anybody opens my project in visual studio or any other editor, the method should be invisible. How can I do this.
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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
9449
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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
6735
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
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...
1
3261
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
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.