title: Using Python to find LUKS passphrase
body: <p>I have an encrypted volume for which I can almost, but not quite, remember the password.</p>
  
  <p>There are 10 characters that I am uncertain of: some are casing, some letter vs number, and possibly being omitted completely.</p>
  
  <p>I can have python print a list of all the possible passwords, but how can I have it also test them to determine the correct answer rather than going down the list typing them myself?</p>
  
  <p>Example of what I've got so far- let's say the passphrase is some play on "the_pass"</p>
  
  <pre><code>passparts = [["t", "T"], ["h"], ["e", "3"], ["_", ""], ["p"], ["a", "4"], ["s"], ["s"]]
  possibilities = itertools.product(*passparts)
  for x in possibilities:
      possible = "".join(x)
      print possible
  </code></pre>
  
  <p>Is it possible to have python test 'possible' each time to see if it can decrypt the volume?</p>
  
  <p>also my real world problem has 2*2*2*2*2*2*2*2*2*3 = 1536 possibilities, I assume python can test each one fast enough that this wouldn't be a problem?</p>