Encoding Password in .NET

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
tiagohumbs
Posts: 1
Joined: Sat Feb 24, 2007 3:39 am

Encoding Password in .NET

Post 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 
Last edited by tiagohumbs on Sat Dec 19, 2009 4:48 am, edited 1 time in total.
iamcypher
Posts: 57
Joined: Thu Oct 22, 2009 3:13 pm

Re: Encoding Password in .NET

Post by iamcypher »

Hello,

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

iamcypher.
Stealth
Posts: 8
Joined: Mon Jul 06, 2009 8:43 am

Re: Encoding Password in .NET

Post by Stealth »

Thanks for the VB.NET code man , your awesome.
I ll go make an account manager in .NET soon.
Post Reply