Android Question Convert String to MD5 and Back?

hasexxl1988

Active Member
Licensed User
Longtime User
Hello, maybe someone can help me:

I'm looking for a way to convert an existing MD5 string into the opening text.

Normal string: Thomas
MD5: 2042101AC1F6E7741BFE43F3672E6D7C

Now I want to change the MD5 value (2042101AC1F6E7741BFE43F3672E6D7C) back to the original value.

I have already searched but always found only the information how to convert a string to MD5 but not how to convert it back :(
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
In VB.NET I found the following:

Encrypt:
B4X:
Public Function Encrypt(clearText As String) As String
        Dim EncryptionKey As String = "$kldfKFSAK37236780!!*+++hHUDO723BNU!$hask+*jhds7!2929j$+jP*!hWrT$kldfKFSAK37236780!!*+++hHUDO723BNU!$hask+*jhds7!2929j$+jP*!hWrT"
        Dim clearBytes As Byte() = Encoding.Unicode.GetBytes(clearText)
        Using encryptor As Aes = Aes.Create()
            Dim pdb As New Rfc2898DeriveBytes(EncryptionKey, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
            encryptor.Key = pdb.GetBytes(32)
            encryptor.IV = pdb.GetBytes(16)
 
            Using ms As New MemoryStream()
                Using cs As New CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write)
                    cs.Write(clearBytes, 0, clearBytes.Length)
                    cs.Close()
                End Using
                clearText = Convert.ToBase64String(ms.ToArray())
            End Using
        End Using
        Return clearText
    End Function

Decrypt:

B4X:
Public Function Decrypt(cipherText As String) As String
        Dim EncryptionKey As String = "$kldfKFSAK37236780!!*+++hHUDO723BNU!$hask+*jhds7!2929j$+jP*!hWrT$kldfKFSAK37236780!!*+++hHUDO723BNU!$hask+*jhds7!2929j$+jP*!hWrT"
        Dim cipherBytes As Byte() = Convert.FromBase64String(cipherText)
        Using encryptor As Aes = Aes.Create()
            Dim pdb As New Rfc2898DeriveBytes(EncryptionKey, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
            encryptor.Key = pdb.GetBytes(32)
            encryptor.IV = pdb.GetBytes(16)
 
            Using ms As New MemoryStream()
                Using cs As New CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write)
                    cs.Write(cipherBytes, 0, cipherBytes.Length)
                    cs.Close()
                End Using
                cipherText = Encoding.Unicode.GetString(ms.ToArray())
            End Using
        End Using
        Return cipherText
    End Function
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
That I know MD5 is unidirectional, there is no decoding.
And anyway it's not very safe, it has some flaws.

It was used to encrypt the passwords you enter on MSN Messenger.

Other algorithms are bidirectional.
 
Upvote 0
Top