Click here to Skip to main content
15,845,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
anyone having the MD5 to text string converter using vb6.
I am following the link that will convert the string into MD5 hash
link: Using VB to Create & Check License Keys[^]
Private Const MyProductName ="Office Trainer"
 . . .
If Not (UserNameT = "") Or Not (ProdNameT = "") Then
  RawKey = GenKeyString(UserNameT, ProdNameT & MyProductName, FeatID)
  BinKey = HexStrToBinStr(RawKey)
  KeyCode = FormatKeyCode(Base32Enc(BinKey), 4)
Else
  KeyCode = "Please Enter Licensee and/or Serial Number;
End If
. . .


I m getting the Rawkey. now i want to get the original value using MD5 description.
Posted
Updated 9-Aug-10 4:50am
v2
Comments
OriginalGriff 9-Aug-10 10:45am    
When I say "You can't do it" I don't mean "that's a bad idea, you should find a better solution" I mean "You can't do it because the laws of physics say it doesn't work". Try this simple example: "x / y = 2".
Given that the answer is 2, find the pair of numbers "x" and "y" that I was originally thinking of. I will give you a clue: both numbers are less than 10 to the power 17841.

1 solution

You can't. MD5 is not an encryption mechanism, it is a hashing algorithm. That means it is what is called a non-reversable process.
Think about it: and MD5 is 128 bits long.
If you take the MD5 of a 256GB file, it is still 128 bits long. How would you re-generate the missing data? (if you could do it, pattent it quickly - that kind of compression is worth a fortune)
If you need to go both ways, you need an encryption algorithm instead.
 
Share this answer
 
Comments
meBalkrishna 9-Aug-10 10:37am    
thanks a lot!!
But i have reach to some extend....lets see.
i can do the verification of that key...now i am trying to get the vales for the same.
refer this code..if possible try to get the solution...



Public Function ValidateKeyCode(ByVal KeyCode, UserName, ProjName As String) As Boolean
Dim ActiveBytes As String
Dim LUNameHash As String
Dim LUName As String
Dim ValidKey As Boolean
Dim KeyMD5 As String
Dim KeySig As String

ValidKey = False

' Key must be 32 bytes long - otherwise reject immediately

If Len(KeyCode) = 32 Then
BinKeyCode = HexStrToBinStr(KeyCode)
ActiveBytes = Right(BinKeyCode, 14)
KeyMD5 = DigestStrToHexStr(ActiveBytes)
ValidSig = Left(KeyMD5, 2) & Right(KeyMD5, 2)
KeySig = Left(KeyCode, 4)

If KeySig = ValidSig Then
ValidKey = True
Else
ValidKey = False
End If

If ValidKey Then
LUName = LCase(UserName) & LCase(ProjName)
LUNameHash = DigestStrToHexStr(LUName)

ActiveBytes = Mid(KeyCode, 5, 24)
LUNameHash = Mid(LUNameHash, 5, 24)

If ActiveBytes = LUNameHash Then
ValidKey = True
Else
ValidKey = False
End If
End If

Else
ValidKey = False
End If

ValidateKeyCode = ValidKey

End Functio

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900