예제 #1
0
      for c in permute(candidate):
        if c in already:
          continue
        yield c
        already.add(c)

def generate_all_sentence_candidates(dictionary_file):
  already = set()
  for line in open(dictionary_file):
    line = line.strip()
    candidates = permute(line)
    for c in candidates:
      if c in already:
        continue
      yield c
      already.add(c)


def try_all(dictionary_file):
  #for c in generate_all_sentence_candidates(dictionary_file):
  for c in generate_all_candidates_of_length(dictionary_file):
    print '> ', c
    if try_candidate(c):
      return c
  return ''

try_all(DICTIONARY_FILE)

truecrypt.dismount()
os.rmdir(MOUNT_PT)
예제 #2
0
 def tearDown(self):
   truecrypt.dismount()
   os.rmdir(test_mount)