473,322 Members | 1,718 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.

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 #1
12 4597
You can use a 3rd party obfuscator to rename identifiers, etc. Most
obfuscators allows you to encrypt strings, or you can encrypt if yourself,
with simple methods (reversing, XORing, etc.) or using the
System.Security.Cryptography namespace. Of course, if your app must decrypt
it at run-time, the key will be in the assembly and someone could decrypt
it, but you are raising the bar.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Sharon" <Sh****@discussions.microsoft.com> escribió en el mensaje
news:D6**********************************@microsof t.com...
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 #2
I would not recommend actually putting personal details anywhere you dont
want them hacked. If you must put this information in then obfuscate it.

--
Terry Burns
http://TrainingOn.net

"Sharon" <Sh****@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
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 #3
Sharon,

You can read and implement some of these answers in this newsgroup on your
question.

http://groups-beta.google.com/group/...rch+this+group

I hope this helps?

Cor
Nov 16 '05 #4
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.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName")
MyMail.Fields.Add("http://schemas.microsoft.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 #5
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.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName")
MyMail.Fields.Add("http://schemas.microsoft.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 #6
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:

MailMessage MyMail = new MailMessage()
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName")
MyMail.Fields.Add("http://schemas.microsoft.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 #7
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:

MailMessage MyMail = new MailMessage()
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName")
MyMail.Fields.Add("http://schemas.microsoft.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?

Nov 16 '05 #8
Hi again,

1) Why don´t you use the SMTP server of the user instead of yours? That
would avoid authentication...

2) If you really need it, then you can encrypt that data so it is no so
easily seen with a decompiler.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Sharon" <Sh****@discussions.microsoft.com> escribió en el mensaje
news:DB**********************************@microsof t.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:

MailMessage MyMail = new MailMessage();
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1");
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"UserName");
MyMail.Fields.Add("http://schemas.microsoft.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?

Nov 16 '05 #9
Sharon,

I think that when you have the answer on this, you should not sent it in a
newsgroup, you become miljonair.

I think that now every organisation which has to do with creditcards sent
that kind of messages seperated and in my country not by email however by
normal mail.

Cor
Nov 16 '05 #10
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.Add("http://schemas.microsoft.com/cdo/configuration/smtpau
thenticate", "1");
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendus
ername", "UserName");
MyMail.Fields.Add("http://schemas.microsoft.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.Add...


*** 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****@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.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.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1");
MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"UserName");
MyMail.Fields.Add("http://schemas.microsoft.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
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...
0
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++...
14
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...
0
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...
3
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
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. ...
3
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...
2
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
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...
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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

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.