security - AsPlainText 安全性

标签 security powershell powershell-3.0 plaintext powershell-cmdlet

试图澄清 -AsPlainText ConvertTo-SecureString 中的参数小命令:

-AsPlainText

Specifies a plain text string to convert to a secure string. The secure string cmdlets help protect confidential text. The text is encrypted for privacy and is deleted from computer memory after it is used. If you use this parameter to provide plain text as input, the system cannot protect that input in this manner. To use this parameter, you must also specify the Force parameter.



谁能解释上面粗体声明所暗示的安全隐患是什么?使用此参数将字符串的内容加密到文件中是否安全?

最佳答案

SecureString 的重点是在内存中加密字符串。 ConvertTo-SecureString -AsPlainText的目的|是将已经明文的密码转换为安全的密码。但是,问题在于您在内存中已经有一个纯文本字符串,这并不能真正为您提供太多保护。
ConvertTo-SecureString更喜欢采用已经加密的字符串和 key 并将它们转换为安全字符串,因此明文值永远不会存储在任何地方的内存中。或者,您也可以使用其他方法来创建 SecureString,例如 Read-Host -Prompt "Enter password" -AsSecureString

关于security - AsPlainText 安全性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25124582/

相关文章:

mysql C ssl连接使用什么密码?

没有 SecurityManager 的 Java RMI

regex - 在文件中搜索RegEx字符串,仅返回文件名,路径和字符串

powershell - 在单个服务器上获取修补程序

powershell排序对象无法按预期工作

azure 连接尝试失败,因为连接方在一段时间后没有正确响应

.net - 如何避免 ASP.NET 应用程序中的 SQL 注入(inject)攻击?

json - 从JSON提取值

c# - PowerShell中的对象相等标准是什么?ServiceController如何定义Equals方法?

powershell - 为什么我不能让我的模块从 PSModulePath 中的目录加载?