For an assignment of mine, I have to write a Python program to crack a locked PDF file. The password policy for this file is as follows:
The password is of the form of w1w2w3 where w1,w2 and w3 are three consecutive words, taken from a 50,0000 word story without “e”, concatenated with any o’s replaced with “0” (zero)
from random import shuffle
data = open('randomwords.txt', 'r').read().split()
for x in data[:3]:
I have modified one answer posted here, Actually i wanted to edit that answer but deleted by the author.
res = "" for x in data[:3]: res += x res.replace("o", "0") print res
res = "" for x in data[:3]: res = res + x print res.replace("o", "0")
Try Last one.