1

I have some application that runs 8 BATCH files on the machine. I want to encrypt the contents of the BATCH files - and make only the application that make those batch files to run will be able to interpret the encryption and make those BATCH files to run.

Any ideas how to do this?

( i don't want to save any un-encryped file on the machine )

Ray Cheng
  • 12,230
  • 14
  • 74
  • 137
Yanshof
  • 9,659
  • 21
  • 95
  • 195
  • possible duplicate of [Simple 2 way encryption for C#](http://stackoverflow.com/questions/165808/simple-2-way-encryption-for-c-sharp) – BlackICE Jul 09 '13 at 05:37
  • BlackICE - my question does not answered already on the link that you past here. My question is totally different – Yanshof Jul 09 '13 at 05:42
  • 1
    The problem is if you have your heart set on batch, there is not much you can do as it must be written out to the filesystem in unencrypted form to be executed at some point. During that step a user could copy the unencrypted files. Would storing non sensitive information in the file and passing sensitive information like passwords in as arguments work? If you can't do that, could you switch to a different scripting technology like Power-Shell? (Batch files are considered "deprecated" and Microsoft is trying to push everyone to Power-Shell anyway) – Scott Chamberlain Jul 09 '13 at 05:46
  • 1
    You need to provide more info on what are you trying to do. Otherwise, you are only asking for a simple way to encrypt in c# which is answered many times here. – Ray Cheng Jul 09 '13 at 05:47
  • To deleted comment: Yes but what are you going to pass as the arguments to `System.Diagnostics.Process`? You can do something like that [with Power-Shell using the `System.Management.Automation.Runspaces` namespace](http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C), but you can't do it with batch. (unless you write your own batch file parser and run the file line by line) – Scott Chamberlain Jul 09 '13 at 05:56
  • What is your intention? There might be a better way to achieve what you want. – Samuel Jul 09 '13 at 06:22

0 Answers0