• <legend id='EKrjM'><style id='EKrjM'><dir id='EKrjM'><q id='EKrjM'></q></dir></style></legend>

    1. <tfoot id='EKrjM'></tfoot>

      <small id='EKrjM'></small><noframes id='EKrjM'>

    2. <i id='EKrjM'><tr id='EKrjM'><dt id='EKrjM'><q id='EKrjM'><span id='EKrjM'><b id='EKrjM'><form id='EKrjM'><ins id='EKrjM'></ins><ul id='EKrjM'></ul><sub id='EKrjM'></sub></form><legend id='EKrjM'></legend><bdo id='EKrjM'><pre id='EKrjM'><center id='EKrjM'></center></pre></bdo></b><th id='EKrjM'></th></span></q></dt></tr></i><div id='EKrjM'><tfoot id='EKrjM'></tfoot><dl id='EKrjM'><fieldset id='EKrjM'></fieldset></dl></div>
      • <bdo id='EKrjM'></bdo><ul id='EKrjM'></ul>

        C# PasswordDeriveBytes 混淆

        时间:2023-06-02

          <tfoot id='nl5HX'></tfoot>
          <i id='nl5HX'><tr id='nl5HX'><dt id='nl5HX'><q id='nl5HX'><span id='nl5HX'><b id='nl5HX'><form id='nl5HX'><ins id='nl5HX'></ins><ul id='nl5HX'></ul><sub id='nl5HX'></sub></form><legend id='nl5HX'></legend><bdo id='nl5HX'><pre id='nl5HX'><center id='nl5HX'></center></pre></bdo></b><th id='nl5HX'></th></span></q></dt></tr></i><div id='nl5HX'><tfoot id='nl5HX'></tfoot><dl id='nl5HX'><fieldset id='nl5HX'></fieldset></dl></div>
            <bdo id='nl5HX'></bdo><ul id='nl5HX'></ul>
            <legend id='nl5HX'><style id='nl5HX'><dir id='nl5HX'><q id='nl5HX'></q></dir></style></legend>
              <tbody id='nl5HX'></tbody>

            1. <small id='nl5HX'></small><noframes id='nl5HX'>

                • 本文介绍了C# PasswordDeriveBytes 混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我在 C# 中有以下代码

                  I have following code in C#

                  PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
                  byte[] KeyBytes = DerivedPassword.GetBytes(32);
                  

                  我正在使用SHA1"哈希算法.

                  I am using "SHA1" hashing algorithm.

                  根据 SHA1 定义,它生成 160 位(20 字节)的密钥.我的问题是 GetBytes 方法如何从 DerivedPassword 中获取 32 个字节,GetBytes 方法背后使用了什么算法?

                  According to SHA1 definition, its generate 160 bits (20 bytes) key. My question is how GetBytes method get 32 bytes from DerivedPassword, what algorithm used behind GetBytes method?

                  推荐答案

                  Microsoft 对原始 PKCS#5(又名 PBKDF1)的实现包括 insecure 扩展,以提供比散列函数所能提供的更多的字节(参见错误报告此处和这里).

                  Microsoft's implementation of original PKCS#5 (aka PBKDF1) include insecure extensions to provide more bytes than the hash function can provide (see bug reports here and here).

                  即使它没有错误,您也应该避免对标准进行未记录的专有扩展(否则您将来可能永远无法解密您的数据 - 至少不能在 Windows 之外.)

                  Even if it was not buggy you should avoid undocumented, proprietary extensions to standards (or you might never be able to decrypt your data in the future - at least not outside Windows.)

                  强烈建议您使用更新的 Rfc2898DeriveBytes,它实现了自 .NET 2.0 起可用的 PBKDF2 (PKCS#5 v2).

                  I strongly suggest you to use the newer Rfc2898DeriveBytes which implements PBKDF2 (PKCS#5 v2) which is available since .NET 2.0.

                  这篇关于C# PasswordDeriveBytes 混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:给定一个私钥,是否可以导出它的公钥? 下一篇:应该添加还是删除这些论点?

                  相关文章

                  最新文章

                  <tfoot id='wd2VB'></tfoot>

                • <i id='wd2VB'><tr id='wd2VB'><dt id='wd2VB'><q id='wd2VB'><span id='wd2VB'><b id='wd2VB'><form id='wd2VB'><ins id='wd2VB'></ins><ul id='wd2VB'></ul><sub id='wd2VB'></sub></form><legend id='wd2VB'></legend><bdo id='wd2VB'><pre id='wd2VB'><center id='wd2VB'></center></pre></bdo></b><th id='wd2VB'></th></span></q></dt></tr></i><div id='wd2VB'><tfoot id='wd2VB'></tfoot><dl id='wd2VB'><fieldset id='wd2VB'></fieldset></dl></div>
                    <bdo id='wd2VB'></bdo><ul id='wd2VB'></ul>

                    1. <legend id='wd2VB'><style id='wd2VB'><dir id='wd2VB'><q id='wd2VB'></q></dir></style></legend>

                      <small id='wd2VB'></small><noframes id='wd2VB'>