Large Posted July 11, 2004 Share Posted July 11, 2004 Hi Guys, Could someone please give me an example of how use encryption in VB.Net, ie: Encrypted a string so that I can write a password to a dataset and then read it back out of the dataset ? Any help much appreciated. Kind Regards Link to comment Share on other sites More sharing options...
0 Winston Posted July 12, 2004 Share Posted July 12, 2004 Well it's quite a common topic, try googling it first, here's a result from google: http://www.devarticles.com/c/a/VB.Net/Stri...ual-Basic-.NET/ Link to comment Share on other sites More sharing options...
0 bangbang023 Veteran Posted July 12, 2004 Veteran Share Posted July 12, 2004 here's a sample of encrypting: dim ftppassword as string = "testing" Dim des As New TripleDESCryptoServiceProvider Dim hashmd5 As New MD5CryptoServiceProvider Dim pwdhash As Byte() Dim buff As Byte() Dim password As String password = "randomisbetter" pwdhash = hashmd5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(password)) hashmd5 = Nothing des.Key = pwdhash des.Mode = CipherMode.ECB buff = ASCIIEncoding.ASCII.GetBytes(ftpPassword) Dim temp As String = Convert.ToBase64String(des.CreateEncryptor().TransformFinalBlock(buff, 0, buff.Length)) des = Nothing Link to comment Share on other sites More sharing options...
0 Large Posted July 12, 2004 Author Share Posted July 12, 2004 Thanks bangbang023, Must helpful ! :happy: Link to comment Share on other sites More sharing options...
Question
Large
Hi Guys,
Could someone please give me an example of how use encryption in VB.Net, ie: Encrypted a string so that I can write a password to a dataset and then read it back out of the dataset ?
Any help much appreciated.
Kind Regards
Link to comment
Share on other sites
3 answers to this question
Recommended Posts