我正在研究.NET Windows應用程序,該應用程序將使用Process.Start啓動在同一臺PC上運行的另一個內部開發的.NET應用程序。我需要將數據庫連接信息(包括用戶標識和密碼)傳遞給目標應用程序。我試圖確定在發送之前是否需要加密信息。我應該將敏感數據傳遞給.NET中的Process.Start調用嗎?
假設最終用戶的PC沒有受到威脅,如果我在參數中傳遞未加密的連接信息,連接信息是否會暴露在任何地方?
將這樣的事情是OK ...
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);
好點。爲了澄清,我沒有具體的「從誰」。我只是想估計未加密數據傳遞的一般風險,並且看看數據可能暴露在什麼類型的情況下。 – 2009-06-16 14:31:14