Convertir Cualquier Cadena De Texto A Md5

Iniciado por kraft, Marzo 11, 2013, 11:14:11 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Marzo 11, 2013, 11:14:11 PM Ultima modificación: Enero 05, 2015, 09:57:07 AM por Expermicid
Es tema pasado, pero quería probar esto de los foros  :P
en No tienes permitido ver los links. Registrarse o Entrar a mi cuenta se agregan 2 textbox's y un button, y los que conozcan el tema ya entienden lo que digo
si alguno tiene dudas (que no creo) estaré dispuesto a hacer lo que pueda
bien, ahi está:
_____________________________________________________________________
Código: csharp
Imports System.Text
Imports System.Security.Cryptography
Public Class Form2
   

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        CifradoMd5(TextBox1.Text)
    End Sub
    Private Sub CifradoMd5(ByVal TextoCifrar As String)
        Dim TextoCifrado As String
        TextoCifrado = ""
        Dim md5 As New MD5CryptoServiceProvider
        Dim bytValue() As Byte
        Dim bytHash() As Byte
        Dim i As Integer

        bytValue = System.Text.Encoding.UTF8.GetBytes(TextoCifrar)

        bytHash = md5.ComputeHash(bytValue)
        md5.Clear()

        For i = 0 To bytHash.Length - 1
            TextoCifrado &= bytHash(i).ToString("x").PadLeft(2, "0")
        Next
        TextBox2.Text = TextoCifrado
        Form1.TextBox3.Text = TextoCifrado
    End Sub
End Class

_______________________________________________________________