Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 VB
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 9-Aug-10 3:18am
Edited 9-Aug-10 3:50am
v2
Comments
OriginalGriff at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
BalkrishnaRaut8838 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 853
1 OriginalGriff 410
2 CPallini 275
3 George Jonsson 226
4 Richard Deeming 145
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,482
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 9 Aug 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100