我正在开发一个.NET Windows应用程序,将使用Process.Start启动在同一台计算机上运行的另一个内部开发的.NET应用程序。我需要传递数据库连接信息,包括用户ID和密码,到目标应用程序。我想确定是否需要在发送之前加密这些信息。
假设最终用户的计算机没有被攻击,如果我在参数中传递未加密的连接信息,那么这些信息会暴露在任何地方吗?
类似这样的东西是否可行...
或者我应该使用类似这样的东西...
假设最终用户的计算机没有被攻击,如果我在参数中传递未加密的连接信息,那么这些信息会暴露在任何地方吗?
类似这样的东西是否可行...
string myExecutable = "myApp.exe";
string server = "myServer";
string database = "top_secret_data";
string userID = "myUser";
string password = "ABC123";
string dbInfo = string.Format("server={0} database={1} userID={2} password={3}", server, database, userID, password);
ProcessStartInfo startInfo = new ProcessStartInfo(myExecutable, dbInfo);
Process.Start(startInfo);
或者我应该使用类似这样的东西...
var crypto = new MySymmetricCryptoLib.Crypto();
string myExecutable = "myApp.exe";
string server = crypto.Encrypt("myServer");
string database = crypto.Encrypt("top_secret_data");
string userID = crypto.Encrypt("myUser");
string password = crypto.Encrypt("ABC123");
string dbInfo = string.Format("server={0} database={1} userID={2} password={3}", server, database, userID, password);
ProcessStartInfo startInfo = new ProcessStartInfo(myExecutable, dbInfo);
Process.Start(startInfo);