I was attempting to use this class however I do not see the ProtectedData class under System.Security.Cryptography. Any reason why!

This is what I have so far ...

Imports System.Security.Cryptography
Imports System.text.Encoding
Imports System

Public Class Security
Private Shared arrEntropybyte As Byte() = {1,2,3,4,5,6,7,8,9,0}

Public Shared Function Encrypt(ByVal stringToEncrypt As String) As String
Dim arrStringbyte As Byte()
Dim encryptedDBString As Byte()
' Convert the string to a byte array:
arrStringbyte = Unicode.GetBytes(stringToEncrypt)
' Encrypt string
encryptedDBString = ProtectedData.Protect(stringToEncrypt, arrEntropybyte, DataProtectionScope.CurrentUser)
Catch ex As Exception
Throw ex
End Try
End Function
End Class

Relevant Pages

  • Re: System.Security.Cryptography.ProtectedData
    ... ProtectedData class under System.Security.Cryptography. ... Public Shared Function Encrypt(ByVal stringToEncrypt As String) As ... Dim arrStringbyte As Byte ... Dim encryptedDBString As Byte ...
  • How to use API calls in VS2005 for printing
    ... Public WriteOnly Property _DocumentNameAs String ... Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) As Boolean ... Dim hPrinter As IntPtr ' The printer handle. ...
  • Re: How to print like the old ways
    ... Public pDocName As String ... Public Shared Function OpenPrinter(ByVal src As String, ByRef hPrinter As IntPtr, ByVal pd As Long) As Boolean ... Dim dwWritten As Int32 ' The number of bytes written by WritePrinter. ...
  • Re: (vb2005) I need your help for using "Rasapi32.dll"
    ... Declare Function RasGetEntryDialParams Lib "rasapi32.dll" Alias ... "RasGetEntryDialParamsA" (ByVal lpcstr As String, ... Private Declare Function InternetDial Lib "wininet.dll" Alias ... Public Shared Function InternetDial(ByVal hWndParent As IntPtr, ...
  • BC30518: Overload resolution failed because no accessible ToString can be called with these argument
    ... Microsoft Visual Basic .NET Compiler version 7.10.6310.4 ... 'Public Shared Function ToString(value As String) As String': ...