Mayur  Gujrathi

Mayur Gujrathi

  • 377
  • 4.1k
  • 1m

encryption decryption

May 26 2011 7:08 AM
dear all i am encrypting my password like this
but dont know how to decrypt

Function HashPassword(ByVal password As String) As String
        Dim hashedPassword As String
        Dim hashProvider As SHA256Managed

        Try
            Dim passwordBytes() As Byte
            Dim hashBytes() As Byte
            passwordBytes = System.Text.Encoding.Unicode.GetBytes(password)
            hashProvider = New SHA256Managed
            hashProvider.Initialize()
            passwordBytes = hashProvider.ComputeHash(passwordBytes)
            hashedPassword = Convert.ToBase64String(passwordBytes)
         
          
        Finally
            If Not hashProvider Is Nothing Then
                hashProvider.Clear()
                hashProvider = Nothing
            End If
        End Try

Answers (8)