+ Reply to Thread
Results 1 to 7 of 7

Thread: Passwords

  1. #1
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Passwords

    So I found an old backup and have a encrypted file. I know some of the letters in the password so I tried searching for a bruteforce program but I kinda gave up on that lol. I figured it wouldnt take much to figure this out myself.

    Then I ran into this problem. If I have the possible characters into an array, I figured if I just put it into a loop and go through each character and inside that go through each charcter, etc I would get all the possibilities.

    Code:
    <pre>
    <?PHP
    $eol 
    "\n";
    $chars = array("a""b""c");
    $i 0;
    while(
    $i count($chars)) {
        
    $ii 0;
        while(
    $ii count($chars)) {
            
    $iii 0;
            while(
    $iii count($chars)) {
                echo 
    $chars[$i].$chars[$ii].$chars[$iii].$eol;
                
    $iii++;
            }
            
    $ii++;
        }
        
    $i++;
    }
    ?>
    </pre>
    Basically if I have this it echos out:
    aaa
    aab
    aac
    aba
    abb
    abc
    aca
    acb
    acc
    baa
    bab
    bac
    bba
    bbb
    bbc
    bca
    bcb
    bcc
    caa
    cab
    cac
    cba
    cbb
    cbc
    cca
    ccb
    ccc
    Which is correct but what if I want more than 3 caracters? Is there an easier way to do this then to embed more loops inside the loops? In that case if I wasnt sure if it was say 6 characters or 7 characters id have to run the program with 6 loops, then that fails I go again with 7? Is there a way to do this and just run it once? There has gotta be another way then 17+ embed loops lol

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: Passwords

    Yup, you can use recursion to get it done easier. Modified this script here to fit your needs: Brute Force PHP Script : eternal rise

  3. #3
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Re: Passwords

    Ah recursion - should look more into this have not did to much with it quite yet besides the basic loop lol.

    Thanks for it tho this really helps =)

  4. #4
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: Passwords

    It is a neat subject to look into and work with.

  5. #5
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Re: Passwords

    Yes, I believe my data structure teacher said recursion is a main concept in computer science.

  6. #6
    Moderator Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan's Avatar
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Age
    34
    Posts
    2,606
    Blog Entries
    7

    Re: Passwords

    Yes it is, there is even whole program languages based purely on recursion. (PROLOG at least), where you have a fact, which can contain of a fact and a list and the list can contain a fact and a list etc...
    __________________________________________
    Ask me: Orjan | Contribute to the Wiki! | Make your own Programming blog!
    I usually play eRepublik and Travian when I'm not on CodeCall

  7. #7
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,882
    Blog Entries
    25

    Re: Passwords

    Quote Originally Posted by orjan View Post
    Yes it is, there is even whole program languages based purely on recursion. (PROLOG at least), where you have a fact, which can contain of a fact and a list and the list can contain a fact and a list etc...
    Just because Prolog doesn't have loops doesn't mean it is based on recursion. However, Prolog _is_ based on logic.

+ 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. Best Passwords?
    By Wanch in forum Linux/Unix General
    Replies: 25
    Last Post: 02-01-2009, 02:34 PM
  2. Passwords
    By travy92 in forum Visual Basic Programming
    Replies: 6
    Last Post: 10-06-2007, 10:33 AM
  3. Passwords?
    By littlefranciscan in forum General Programming
    Replies: 3
    Last Post: 03-06-2007, 03:22 PM
  4. Passwords
    By Chan in forum C# Programming
    Replies: 5
    Last Post: 08-07-2006, 07:26 AM
  5. Passwords
    By NeedHelp in forum Technology Ramble
    Replies: 3
    Last Post: 07-21-2006, 03:20 PM

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