Page 1 of 1

Encoding Password in .NET

Posted: Mon Nov 23, 2009 2:16 am
by tiagohumbs
C#.NET

Code: Select all

 using System.Security.Cryptography;public class L2User{      static internal string Encode(string value)    {        SHA1 sha = new SHA1Managed();        return Convert.ToBase64String(sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)));    }  } 
VB.NET

Code: Select all

 Imports System.Security.Cryptography Public Class L2User      Friend Shared Function Encode(ByVal value As String) As String        Dim sha As SHA1 = New SHA1Managed()        Return Convert.ToBase64String(sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)))    End Function  End Class 

Re: Encoding Password in .NET

Posted: Sat Nov 28, 2009 5:06 pm
by iamcypher
Hello,

Thanks for the c# code, i kinda needed it.

iamcypher.

Re: Encoding Password in .NET

Posted: Tue Dec 01, 2009 9:55 am
by Stealth
Thanks for the VB.NET code man , your awesome.
I ll go make an account manager in .NET soon.