【问题标题】:Public Overrides Function GetBytes() As Byte() is obsolete公共覆盖函数 GetBytes() 因为 Byte() 已过时
【发布时间】:2010-12-02 10:13:17
【问题描述】:

诗人想表达什么?

Public Overrides Function GetBytes() As Byte() 已过时:Rfc2898DeriveBytes 取代 PasswordDeriveBytes 以从密码中获取密钥材料,并且在新应用程序中是首选。

我应该换这个吗...

Dim keyBytes As Byte()
keyBytes = password.GetBytes(keySize / 8)

...用什么?

【问题讨论】:

    标签: security cryptography rijndael obsolete rfc2898


    【解决方案1】:
    // Constructor needs parameters...fill in with yours
    Dim password as new Rfc2898DeriveBytes(yourParamsHere)
    
    Dim keyBytes As Byte()
    keyBytes = password.GetBytes(keySize / 8)
    

    【讨论】:

      【解决方案2】:

      您缺少代码的关键部分。正是那部分将密码声明为 PasswordDeriveBytes。将其更改为 Rfc2898DeriveBytes 即可。

      【讨论】:

        【解决方案3】:
        猜你喜欢
        • 2015-09-27
        • 2011-02-18
        • 1970-01-01
        • 2017-06-08
        • 2012-09-21
        • 2010-10-03
        • 1970-01-01
        • 2017-11-16
        • 1970-01-01
        相关资源
        最近更新 更多