Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Break the PIN

Options
2»

Comments

  • Registered Users Posts: 8 endz




  • Closed Accounts Posts: 18,966 ✭✭✭✭syklops


    endz wrote: »

    Well you get the award for the one liner solution.


  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    endz wrote: »

    The reason I didn't start with 1000000 is because the pin in theory could have beginning with a 0.


  • Closed Accounts Posts: 465 ✭✭pacquiao


    pity nobody hardly comments their code


  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    pacquiao wrote: »
    pity nobody hardly comments their code

    Only a few lines of code dude ;) Hardly worth commenting.


  • Advertisement
  • Closed Accounts Posts: 465 ✭✭pacquiao


    dlofnep wrote: »
    Only a few lines of code dude ;) Hardly worth commenting.
    Would be nice to know a few things in English.

    For example. you have a loop with a variable 0 which incs each time the loops is ran. the md5 function is hashing the variable? and checking it against an char?? Might help us beginners.


  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    With mine, I created a wordlist which looked like this:

    0000000, 0000001, 0000002, 0000003.........etc 9999998, 99999999.

    So I load the wordlist which contains this into a variable called $data. I then use the explode() function to create an array of all of the numbers, i separated them with the comma.
    $word = explode(",", $data);
    

    So if I am looping - on the first iteration..

    $word[0] = "00000000"
    $md5 = md5($word[$i])
    $md5 will equal "dd4b21e9ef71e1291183a46b913ae6f2"


    I then check if the substring of the MD5 matches what Damo wants:

    My first substring is: substr($md5,30,2) = "f2"

    It doesn't match what Damo wants, so it skips back to the start of the loop - it keeps doing this until my MD5 substring is equal to "5a". When it is, it will then check the SHA1 substring to see if it matches... Etc...

    It goes on and does this until all 3 substrings of the 3 hash values of whatever digits we are on will match what Damo requires which is:

    MD5 substring will be: 5a
    SHA1 substring will be: f1
    SHA256 substring will be: 91


  • Closed Accounts Posts: 465 ✭✭pacquiao


    That's very nice of you to post a very detailed analysis into what your code is doing.
    $word[0] = "00000000" is this
    
    is this just 4 bytes?00000000


  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    pacquiao wrote: »
    That's very nice of you to post a very detailed analysis into what your code is doing.
    $word[0] = "00000000" is this
    
    is this just 4 bytes?00000000

    No, sorry - that is supposed to be 7 0's.


Advertisement