4

What does the poet try to say?

Public Overrides Function GetBytes() As Byte() is obsolete: Rfc2898DeriveBytes replaces PasswordDeriveBytes for deriving key material from a password and is preferred in new applications.

Should i replace this one...

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

...with what?

OrElse
  • 9,709
  • 39
  • 140
  • 253

3 Answers3

8

You are missing crucial part of your code. It is that part that declares password to be PasswordDeriveBytes. Change that to Rfc2898DeriveBytes and you are good.

Josip Medved
  • 3,631
  • 1
  • 28
  • 36
4
// Constructor needs parameters...fill in with yours
Dim password as new Rfc2898DeriveBytes(yourParamsHere)

Dim keyBytes As Byte()
keyBytes = password.GetBytes(keySize / 8)
Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
1

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

John Boker
  • 82,559
  • 17
  • 97
  • 130