You are on page 1of 1

Imports System.Security.

Cryptography
Imports System.Text
Function Encripta(ByVal strDato As String) As String
Dim enc As New UTF8Encoding
Dim data() As Byte = enc.GetBytes(strDato)
Dim result() As Byte
Dim sha As New SHA1CryptoServiceProvider
Dim md5 As New MD5CryptoServiceProvider
result = sha.ComputeHash(data)
Dim sb As New StringBuilder
For i As Integer = 0 To result.Length - 1
If result(i) < 16 Then
sb.Append("0")
End If
sb.Append(result(i).ToString("x"))
Next
Return sb.ToString.ToUpper
End Function

You might also like