Travis,
Ultimately, this is an exercise in futility. The administrators should
be changing the passwords by hand.
Because you don't want the passwords to be in plain text (so others
can't see, I assume), you would encrypt the file. However, to do that, you
need an encryption key. So you embed the encyrption key into the
application (or the application constructs it from other data available to
it). However, the application can be decompiled.
So you obfuscate it. Unfortunately, there is no foolproof way to
obfuscate your code, and you run the risk of potentially breaking your code
or changing how it works due to the obfuscation process.
And even then, obfuscation is a cat and mouse game. No matter what you
do (even if you compile a native binary), you will always be able to figure
out what the code is going to do.
Ultimately, there is no way that this will be secure, and the password
administration should be handled by other means.
--
- Nicholas Paldino [.NET/C# MVP]
-
mvp@spam.guard.caspershouse.com
<jehugaleahsa@gmail.comwrote in message
news:53d074a9-47a7-4ab8-8591-2414b6711e32@e4g2000hsg.googlegroups.com...
Quote:
Hello:
>
We have a request for an console application to change the
administrative password on our user's machines during an upcoming
update. The console application will be called from a batch file that
the users will be able to see. Therefore, we can't put the user name/
password in the batch file or plain text in the executable. Finally,
the request specifically asked that the executable be configurable so
they can put other user name/passwords in later.
>
How can I recieve a user name/password and embed it in an executable?
I was thinking of having a separate file with the encrypted data in
it. However, I would prefer for there to be just the .exe. I also
don't want to create an installer, because it is just a console
application.
>
How do I do it?
>
Thanks,
Travis