Public Overrides GetBytes () Function Since Byte () is deprecated

What is the poet trying to say?

Public Override Function GetBytes () Because Byte () is deprecated: Rfc2898DeriveBytes replaces PasswordDeriveBytes to get key material from a password and is preferred in new applications.

Should I replace this ...

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

      

... with what?

+2
security obsolete cryptography rijndael rfc2898


source to share


3 answers


You are missing an important piece of code. This is the part that declares the PasswordDeriveBytes password. Change that to Rfc2898DeriveBytes and you're good to go.



+6


source to share


// Constructor needs parameters...fill in with yours
Dim password as new Rfc2898DeriveBytes(yourParamsHere)

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

      



+3


source to share


sounds like what you need http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes.getbytes.aspx

+1


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics