Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / August 2007

Tip: Looking for answers? Try searching our database.

System.Security.Cryptography.ProtectedData

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Abhinav - 17 Aug 2007 15:51 GMT
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
Dominick Baier - 26 Aug 2007 11:16 GMT
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
[quoted text clipped - 22 lines]
> End Function
> End Clas

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.