How can I automate the hacking minigame?

Fallout 3 and Fallout New Vegas have a hacking minigame that’s basically Mastermind. You have a bunch of passwords and four tries. When you get the wrong password, you get the number of letters that were correctly placed. That’s it.

enter image description here

  • Is it a common bug, that the screen turns blue and textures become missing indoors in Fallout: New Vegas? Is there a solution?
  • Skyrim, Fallout 3 and New Vegas: major mouse issues
  • How can I permanently disable the gore in Fallout New Vegas?
  • Fallout 3 runs better on medium settings than low?
  • Can we really hack each pc we come across in Fallout 3?
  • What are some tips for a speed run through Fallout: New Vegas on hardcore mode?
  • How can I play this minigame effectively without resorting to pen and paper and guesswork or tables with the known correct passwords?

  • Slow / Low fps at pipboy inventory, crafting menus, NPC talk, shopping menu etc, how to fix?
  • How do I let go of ED-E?
  • Skyrim, Fallout 3 and New Vegas: major mouse issues
  • Which vendors have a lot of cash?
  • How do I repair my weapons and armor?
  • What is the shop glitch in Fallout 3 / New Vegas?
  • 5 Solutions collect form web for “How can I automate the hacking minigame?”

    I have already automated this for you. My solver is available at:

    Note: this is a single-page application, so you can just save the solver to your hard drive as an HTML file and run it from there.


    Let’s suppose you find the words RAMBO, DUMBO, MAMBA, BRICK, TANKS. Go ahead and enter those into the solver.

    [del] RAMBO -0- -1- -2- -3- -4- 3 moves
    [del] DUMBO -0- -1- -2- -3- -4- 3 moves
    [del] MAMBA -0- -1- -2- -3- -4- 2 moves
    [del] BRICK -0- -1- -2- -3- -4- 3 moves
    [del] TANKS -0- -1- -2- -3- -4- 3 moves

    You can see in the right column some of the words are marked as “2 moves” and some of the words are marked as “3 moves”. This column is a little tricky to explain, but this shows the maximum number of required moves necessary to solve the puzzle under the following conditions:

    1. You select that word next, and

    2. You play perfectly afterwards.

    So you can see that if you select MAMBA, you will need to guess at most two words in order to find the correct word.

    Suppose you select MAMBA, and you have 2 positions correct. Click on the -2- next to MAMBA:

    [del] RAMBO -0- -1- -2- -3- -4-
    [del] DUMBO -0- -1- -2- -3- -4- 1 moves
    [del] MAMBA -0- -1- [2] -3- -4-
    [del] BRICK -0- -1- -2- -3- -4-
    [del] TANKS -0- -1- -2- -3- -4-

    The word must be DUMBO (which is the second move).

    During a playthrough of Fallout 3, I noticed that a large number of terminals mostly had “5 move” words with maybe one or two “4 move” words. This means that using the tool, you can play perfectly and beat those terminals every single time… but without the tool, I would abort after three failed guesses.

    All you need to do is click a word with a low number of moves.

    More information

    You can see why MAMBA is the best by clicking on all of the numbers next to MAMBA. No matter what you click, only one other word will be left (or zero).

    If you pick a different word, like RAMBO, you might still be left with two choices afterwards. For example, if you choose RAMBO but have 3 positions left, you get:

    [del] RAMBO -0- -1- -2- [3] -4-
    [del] DUMBO -0- -1- -2- -3- -4- 2 moves
    [del] MAMBA -0- -1- -2- -3- -4- 2 moves
    [del] BRICK -0- -1- -2- -3- -4-
    [del] TANKS -0- -1- -2- -3- -4-

    How it works

    “View Source” works fine, it’s all JavaScript. If I recall correctly, it recursively calculates the maximum number of moves necessary by examining situations like “what if you choose DUMBO and you have 3 correct”. The maxmoves() function is where it’s at.

    Use the bracket trick to remove false entries and to refresh your guess attempts.

    [II.7] The Bracket Trick

    Hidden in the code block you may be able to find what I like to refer
    to as a “Bracket Trick.” A Bracket Trick is a collection of those
    random punctuation marks that appear between the words that are
    encased in a bracket of any kind. In the code block above, there is
    one hidden in there.

    The second column of the Code Block and the third row contains this

    0xFA10 %’%{.@@}#?|+

    The Bracket trick in this line is:


    Every terminal has a chance to produce bracket tricks, but not every
    terminal will have one. Some may even have multiple tricks. To tell if
    you have found a Bracket Trick all you have to do is hover the cursor
    over the opening bracket. If the entire thing lights up,
    congratulations, you found it!

    A Bracket trick can be between a few different types of brackets:

    <___> [____] {____} (____)

    Any of these can be any size possible in the scope of the code block
    and they can be across many lines.

    A Bracket Trick will never contain a possible password.

    I have found that the best way to search a code blcok for tricks is to
    just move the cursor over every character and if something that is
    not a word lights up, you found one.

    Now that you know what they look like and how to find them easily you
    probably want to know why you want these.

    These have a random chance when clicked to either give you another
    attempt or remove a possibility from the Code Block.

    The best time to use one is when you have 3 attempts remaining so you
    dont try using the word it removes from the block before it does it.

    I should mention that the guide linked/cited is for Fallout3, but the trick is still available in Fallout: New Vegas.

    If you have a copy of Python 3 lying around, you can do this in a jiffy.

    First off, transcribe the passwords in an array like this. (Don’t type in the >>> characters.)

    >>> passwords = ["hideout", "flowing", "blanket", "dealing", "banning", "leaving",
                     "studies", "fencing", "battles", "chamber", "parties", "carrier",
                     "blazing", "various", "working", "beating", "mention", "wanting"]

    We can make a sanity check and make sure all passwords are long the same:

    >>> list(map(len, passwords))
    [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]

    Now we need to see how many letters are the same between any two passwords. It’s a one-liner:

    >>> def distance(a,b):
          return sum(1 for al, bl in zip(a,b) if al == bl) if a != b else -1

    If the passwords are actually the same we return -1 instead of 7 so we can ignore those cases.

    Now we need the code to only pick the passwords that have as many matching characters as the game tells us. This is another one-liner. You give it the list of passwords, what you tried and didn’t work and how many characters were right.

    >>> def refine(candidates, wrong_pw, matches):
          result = list(x for x in candidates if distance(x, wrong_pw) == matches)
          return result

    So let’s say you tied the password “flowing” and got 1 character right. Ouch. You then use what we’ve defined like this:

    >>> passwords = refine(passwords, "flowing", 1); passwords
    ['blanket', 'studies', 'parties', 'carrier', 'mention']

    Okay, how about “studies”… nope, 3 correct letters.

    >>> passwords = refine(passwords, "studies", 3); passwords

    Oh look, that must be the password!

    So, how do we automize the choice of passwords from a pool? What we can do is look at each option and see, in the worst case, how many passwords that leaves us with. We can then pick the one with the lowest amount of worst-case remaining options. That password is the one with the best guarantee of whittling down the field.

    This code checks every password against every other password against every other password to find the best candidate.

    def get_next_guess(passwords):
      scores = {}
      for candidate in passwords:
        results = []
        remainder = (x for x in passwords if x != candidate)
        for correct_pw in remainder:
          no_alternatives = len(refine(remainder, candidate,
                                       distance(candidate, correct_pw)))
        scores[candidate] = max(results)
      return min(scores, key = lambda x: scores[x])

    This guesses ‘parties’ immediately on my computer, which is kind of lucky because ‘beating’ would’ve been just as good of a guess. Let’s instead look at the one in the screenshot, where the correct password was ‘WAITING’.

    >>> passwords = ["cleanse", "grouped", "gaining", "wasting", "dusters", "letting", "endings", "fertile", "seeking", "certain", "bandits", "stating", "wanting", "parties", "waiting", "station", "maltase", "monster"]
    >>> get_next_guess(passwords)
    >>> #incorrect, 6/7 correct
    >>> passwords = refine(passwords, "wanting", 6); passwords
    ['wasting', 'waiting']

    With two passwords left, get_next_guess becomes basically a die roll. Just try the first and then the second, and you’re done in three tries, no restarts.

    (Fun aside. You know the link Colin D shared with the list of 12-character passwords? The writer there picked APPRECIATION. That’s actually the best guess! In that case, it leaves you with no more than two alternatives regardless of what the correct password actually is.)

    I’m using a fairly simple, yet surprisingly efficient algorithm, that can be done without taking notes and can lead to the answer relatively quickly:

    I’m going to explain my algorithm step-by-step and by using your screenshot as example. For our example, we will assume that the result is WAITING. For the sake of not having to scroll up all the time, I’m incorporating the screenshot in this answer.

    Step 1:

    Select the first word: CLEANSE, the result is 0

    Step 2:

    Go for the brackets (see @ColinD’s answer) until you either recovered your lost attempt or there is no more bracket left to use (let’s assume I have retrieved my lost attempt on the first bracket pair). The reason we’re doing this in Step 2, and not Step 1, is because you start hacking with the highest amount of attempts possible. In this case you can not have more than 4 attempts.

    Step 3:

    Go for the next word GROUPED, and compare it with the previous words you’ve tried. They both have an E in common, but those are not at the same position, so the similarity between both is 0, which fits into our potential solution; the result is 0 here as well…

    Step 4:

    Assuming you haven’t used up all brackets, this would be the perfect time to search for another extra attempt.

    Step 5:

    Rinse and repeat. GAINING has a similarity of 1 compared to GROUPED, so it’s not our word. WASTING has a similarity of 0 compared to either CLEANSE or GROUPED (we do not compare WASTING to GAINING, since we skipped that one); the result is 6 this time around, Yeehaa!!

    Step 6:

    From here on, it’s going to be fast: We are searching for a word that differs from WASTING by only a single letter. DUSTERS, LETTING, ENDINGS, FERTILE, SEEKING, CERTAIN, BANDITS, STATING, no, no and no! WANTING, yes!; the result here is 6 yet again.

    Step 7:

    From here on, we know that our solution is WA*TING. Before we continue, we look at how many attempts we have, and how many WA*TING words are left. If we only have 1 attempt left and more than 1 possible solution, we try to find an extra attempt using the brackets. In our case, there’s only 1 word left, WAITING, which is our solution.

    In our example, we used 4 attempts (but recovered 1), so it was a close call.
    Normally, you’ll find the solution much faster, since there are lots of helpful bracket pairs (in our example, there was only 1 pair).

    You do not need any pen or paper using this algorithm, since the GUI already shows you, which words you tried out (not all of them, but mostly enough), so you don’t need to remember them, when comparing your current word with the past ones.

    Always keep an eye on the amount of attempts you have left! If you only have 1 attempt left and no more brackets to use and more than 1 potential solution, then quit hacking and try again.

    With that said, I wish you the best of luck.
    Oh, and don’t try to hack into my PC, because I’d be really sad if you did


    The fact that the passwords you guess with are printed on the lower right of the screen as you guess them makes the process of guessing the right password MUCH easier.

    You pick one. Even getting 0 letters correct helps you eliminate a bunch of passwords. Look for patterns before you start guessing. Are there a pile of words that end in “ING”? If there are, pick one of those first. If you don’t get at least 3 letters right, then you know that ALL of those words that end in ING are not the right ones.

    If you come at it with the right mindset, it shouldn’t require pen and paper, or a second computer running a program. It’s a hacking game. If you really want to make it easier, put more points into Science, or player.modav science 100

    We love Playing Games, especially Video Games.