Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -




Not registered yet?

Post a reply

Go back

Write your message and submit
:) :| :( :D :o ;) :/ :P :lol: :mad: :rolleyes: :cool: | :dizzy :eek :kiss :roflol :rolleyes :shame :down :up :touched :sleep :wave :swear :tongue :what :faint :dunno

Go back

Topic review (newest first)

Laterally Speaking
2007-07-30 04:50:02

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.

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.

2007-07-30 03:23:17

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.

2007-07-29 18:33:07

Laterally Speaking wrote:

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.

Laterally Speaking
2007-07-28 11:31:06

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.

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)))

For check = 1 To 26
    If IsNumeric(Mid(Text1.Text, check, 1)) = False Then
        checks = checks & Asc(Mid(Text1.Text, check, 1))
        checks = checks & Mid(Text1.Text, check, 1)
    End If

If checks = filetext Then
    Frame1.Visible = False
    Frame2.Visible = True
    MsgBox "Incorrect code"
    Text1.Text = ""
    Command1.Enabled = False
End If

Exit Sub


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.

Board footer

Powered by FluxBB