Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
You are not logged in.
Post a reply
Topic review (newest first)
I wrote my program that generates and encrypts keys, then writes the result to a file, such that the above code may read it for comparison.
Having codes like this directly in programs is dangerous. It is very easy to disassemble such a program and find such codes. It's much better to construct the codes from pieces, or even better, calculate the code using some form of operations.
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.
I recently wrote a relatively simple program that imitates your standard installer program. There are four screens to it: the first one, where you have to enter the "CD Code", which is verified in a way that makes it very difficult to deduct, from the code, what the code is. The next window just displays a "Serial Number". The next one asks you what file you want to "modify", either by typing in the path, or by click on the "browse" button. The last part just has two progress bars that "fill up" at a random speed; the upper one moves at 1/100 of the speed of the other.
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.