Re: System.Security.Cryptography.ProtectedData
- From: Dominick Baier <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 26 Aug 2007 10:16:03 +0000 (UTC)
It is in system.security.dll - you have to add that reference manually.
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
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()
Try
' 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
.
- References:
- System.Security.Cryptography.ProtectedData
- From: Abhinav
- System.Security.Cryptography.ProtectedData
- Prev by Date: Re: web.config file
- Next by Date: Re: Makecert certificate generation headache
- Previous by thread: System.Security.Cryptography.ProtectedData
- Next by thread: Visual Studio, GetActiveObject, Vista and UAC
- Index(es):