public bool EncryptString(string password, out string encryptedPassword) { DiagnosticsPasswordEncryption encryption = this.GetEncryption(); if (encryption == null) { encryptedPassword = null; return(false); } encryptedPassword = encryption.EncryptString(password); return(true); }
public bool DecryptString(string encryptedPassword, out SecureString decryptedString) { DiagnosticsPasswordEncryption encryption = this.GetEncryption(); if (encryption == null) { decryptedString = null; return(false); } string text = encryption.DecryptString(encryptedPassword); SecureString secureString = new SecureString(); foreach (char c in text) { secureString.AppendChar(c); } decryptedString = secureString; return(true); }