+ Reply to Thread
Results 1 to 3 of 3

Thread: Algorithms - The Basics (PART 2)

  1. #1
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    Algorithms - The Basics (PART 2)

    Please Read Part 1 First:
    Algorithms - The Basics (PART 1)

    Now, that you are satisfied with your algorithm and instructions it is time to generate results according to your algorithm, so in this case I am going to pick up random numbers and assign each one a letter, of course not B, as that will be the result.

    Now let’s take these as examples:

    A=1234
    C=550
    D=3412

    And apply that formula on these numbers:

    ((((1234 + 3412 ) – 550) / 2 ) * 5 ) ^ 2 = 104857600

    Now let’s not forget that for the program to accept this serial we added some instructions, the program will only take the 2nd, 3rd,4th,5th and 6th numbers, so in our case B would be 048576, if you omit the 0, still the program will not accept it! So download the program and test this, enter the following values as follows:



    And press ‘Register’ (this will not register anything, this will just check if the values given match the algorithm!) and it should accept it! If you are too lazy to work out this algorithm yourself you are free to press the ‘Generate Key’ button and then the ‘->’ button to transfer the values from the generation part to the validation part, as follows:



    Now if you really want to test if this really works, write purely random numbers in all 4 text boxes and it will not work!



    So of course the more complicated and the more mathematical functions your algorithm will have the harder it will be to break! And the additional steps of instructions would make it even more secure and harder for the user to crack and detect the whole algorithm (including the instructions), because if he discovers your formula and gets a result of 500898 (for example) he will have to figure out that the algorithm accepts only a few numbers of that number!

    You can for example accept only the 1st,3rd,5th and so on, or you can apply another formula to that result! So you get a result from the first algorithm/formula, and than to that result you can add another formula. So it will be even harder for the user to crack! All you need to do is just know how to make this into your program, therefore you do need some good programming skills to achieve this, because perhaps the mathematical function can be made easily, but the instruction part might be difficult. And remember having a complicated algorithm is always better than having a simple one, so don’t be lazy, make the best you can, once the algorithm is done at least you can have a more hard to crack application, but as always it is not hack proof, and besides that read my Cracking tutorial here:
    Cracking an Application Method One (PART 1)
    So you can make an even better application, because it will be useless having a very complicated algorithm and then not having a secure application! Because with a simple process it can be cracked easily without the need of knowing the algorithm!

    Now just to help you out this is a simple pseudo code, might help you when it comes to implement it into your program:

    Code:
    Number1 = Get Value of First Text box
    Number2 = Get Value of Second Text box
    Number3 = Get Value of Third Text box
    Number4 = Get Value of Fourth Text box
    Result = ((((Number1 + Number4) - Number3) / 2) * 5) ^ 2 //This is the formula, plain and simple
    Result = Get The Result of the formula, Then Get the 2nd,3rd,4th,5th and 6th values of  it
    If Result = Number2 Then 
    MsgBox "Correct Registration Code"
    Else MsgBox "Incorrect Registration Code”

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    bbqroast's Avatar
    bbqroast is offline Programming God
    Join Date
    Jul 2010
    Posts
    506
    Blog Entries
    9
    Rep Power
    9

    Re: Algorithms - The Basics (PART 2)

    Nice tutorial!!
    What if you made a program where you needed internet when your registered,
    Then some of the parts of the algorithim where sent from the server (if it was A*5+(6*D) and the server sent D)
    Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

  4. #3
    fishsticks's Avatar
    fishsticks is offline Learning Programmer
    Join Date
    Dec 2010
    Posts
    34
    Rep Power
    0

    Re: Algorithms - The Basics (PART 2)

    This is great! What code is this in exactly?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 11-02-2009, 05:46 AM
  2. Replies: 1
    Last Post: 11-02-2009, 05:43 AM
  3. Replies: 6
    Last Post: 08-28-2009, 07:27 PM
  4. Part I: Writing the basics - Calculator
    By Brandon W in forum PHP Tutorials
    Replies: 47
    Last Post: 10-11-2008, 02:48 PM
  5. Algorithms - The Basics (PART 1)
    By TcM in forum Security Tutorials
    Replies: 0
    Last Post: 11-24-2007, 08:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts