- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将 wpf 密码框中的数据转换为安全字符串。这是怎么做到的?到目前为止我所拥有的:
SecureString pass = new SecureString();
pass.AppendChar(pbox1.Password);
这当然行不通,那么我如何在不创建常规字符串的情况下获取密码数据呢?
最佳答案
Per MSDN :
When you get the Password property value, you expose the password as plain text in memory. To avoid this potential security risk, use the SecurePassword property to get the password as a SecureString.
您应该避免使用 Password 属性,除非您绝对需要该字符串的纯文本版本。在这种情况下,直接检索 SecureString。
关于c# - wpf 密码框到 C# 中的 SecureString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2978348/
我使用以下内容来创建密码文件: $path = "C:\Users\USER\Desktop" $passwd = Read-Host "enter desired password" -AsSecu
我一直在研究使用 System.Security.SecureString 类在处理信用卡号时将它们保存在内存中。有没有人使用 SecureString 类来保存信用卡号,或者大多数只使用普通的 Sy
是否有任何关于以安全方式实际使用 SecureString 的指导?我不认为有任何方法可以首先创建安全字符串,因为您将需要在某个时候从文本框中输入它。 最佳答案 可能不想使用 SecureString
是否可以使用 System.Windows.Forms.TextBox(或任何其他方法)输入可随后转换为安全字符串的文本?我希望能够获取输入的值,将其转换为安全字符串并将其写入一个文件,然后可以在需要
是否可以使用 System.Windows.Forms.TextBox(或任何其他方法)输入可随后转换为安全字符串的文本?我希望能够获取输入的值,将其转换为安全字符串并将其写入一个文件,然后可以在需要
提出这个问题的原因:我正在尝试更改运行 Windows 服务的帐户。我决定使用 win32 api 而不是 WMI,并开始查看 ChangeServiceConfig。 我想我可以简单地在非托管方法签
我看到这个线程: When would I need a SecureString in .NET? 代码是: SecureString password = new SecureString("pa
当从数据库传输到本地 SecureString 变量时,如何限制(内存)存储在数据库中的未加密字符串的暴露? 字符串从数据库到达之后,但在转换之前,是否与将其移动到字符串变量然后进行转换一样容易受到攻
从 byte array 创建 SecureString(unicode 编码)的最佳方法是什么?我想将解密的 DEK key 存储在内存中,解密过程由 Azure.KeyVault(api) 进行,
我想在注册表中存储一个 System.SecureString。那可能吗?我将如何着手去做? 下次运行时我的程序是否能够再次解密字符串? 最佳答案 如果没有辅助层,就不可能以加密形式进行操作。它本身不
这个问题在这里已经有了答案: Hashing a SecureString in .NET (4 个答案) 关闭 7 年前。 我相信我误解了 SecureString 的一个基本部分。我知道 str
我见过的所有示例最终都会在使用 SecureString 之前将其转换回标准字符串,从而破坏对象。在没有这个问题的情况下使用安全字符串的好方法是什么? 我知道我可以将 SecureString 编码到
有没有什么方法可以在不包含安全性的情况下获取 SecureString 的值?例如,在下面的代码中,只要您执行 PtrToStringBSTR,字符串就不再安全,因为字符串是不可变的,并且垃圾回收对于
我有一个正在使用MVVM模式实现的WPF应用程序。在此应用程序中,我试图通过附加属性从PasswordBox中获取密码。但是,我得到了上面看到的错误,并且不确定为什么会得到它。这是我所拥有的: XAM
我有一个应用程序,我必须在其中存储密码。这个应用程序被 SYSTEM 用户调用。我已经混淆了脚本并将其存储在安全的位置。 现在我的问题是:是否有可能创建一个可以被一个或多个其他用户解密的 Secure
我在从远程服务器上的 XML 文件创建凭据对象时遇到问题。这是我用来测试的代码 XML 文件 Selected.System.Management.Automati
在探索现有项目时,我刚刚找到了这段代码。我想到的问题是,何时以及为什么我应该使用 SecureString 而不是 string?它提供什么好处? public interface IAuthenti
为什么 System.DirectoryServices.AccountManagement.UserPrincipal.SetPassword() 不采用 System.Security.Secur
在我的一次代码审查中,我偶然发现了 SecureString 的一个有趣的实现。从逻辑上讲,隐藏内存中的值是有好处的,但我对 IConfiguration 的理解是,当通过 Configuration
我对各种转换方法进行了一些研究,并得出了显式或隐式运算符的用法。 注意到 System.Security.SecureString 是一个密封类(不能继承自),是否可以写一个显式 > 或 隐式运算符,
我是一名优秀的程序员,十分优秀!