I chose to use 26 characters because it's a nice, round number.
I would upload the files, but I used some components that you're not likely to have (National Instruments UI 6.0). If anyone here does, say so and I'll post the links to the files. If not, I'll eventually save another version with the standard ones.
]]>The key that is entered into text1 is "JVA6L9-XLB2M5-DFNQ7C1-633I"
Doesn't the key have to have 25 characters not 26? Because most keys on CD's that software installed have 25 characters instead of 26.
]]>The part that is of most interest is the first one. the following is the code:
Private Sub Command1_Click()
Dim check As Variant
Dim checks As String
Dim fh As Integer
Dim countercheck As String
Dim filetext As String
On Error GoTo eh
fh = FreeFile
Open "C:\CDtest1.txt" For Input As #fh
Input #fh, filetext
Close #fh
Dim passer As Variant
For passer = 1 To Int(Len(filetext) / 5)
countercheck = countercheck & Int(Mid(filetext, (passer * 5) - 4, 2) - Asc(Mid(Text1.Text, Int(passer Mod Int(Len(Text1.Text) - 1) + 1), 1)))
Next
For check = 1 To 26
If IsNumeric(Mid(Text1.Text, check, 1)) = False Then
checks = checks & Asc(Mid(Text1.Text, check, 1))
Else
checks = checks & Mid(Text1.Text, check, 1)
End If
Next
If checks = filetext Then
Frame1.Visible = False
Frame2.Visible = True
Else
MsgBox "Incorrect code"
Text1.Text = ""
Command1.Enabled = False
End If
Exit Sub
eh:
MsgBox "Problem: " & Err.Description
Close #fh
End Sub
There is no longer a single key that will pass the test. Now, you need another program will both generate a key for you, and write an encrypted file containing the info that the above code needs in order to verify what you type in.
In case you were wondering, the frames are what I used to have multiple "screens". I simply superimposed them all.