Skip to content

Commit d1ed9ae

Browse files
committed
PEP8 format
1 parent 4542bc4 commit d1ed9ae

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

password_cracker.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@
2424
print 'Please install fcrypt if you are on Windows'
2525

2626

27-
28-
def testPass(cryptPass): # Start the function
27+
def testPass(cryptPass): # Start the function
2928
salt = cryptPass[0:2]
30-
dictFile=open('dictionary.txt','r') # Open the dictionary file
31-
for word in dictFile.readlines(): # Scan through the file
32-
word=word.strip('\n')
33-
cryptWord=crypt.crypt(word,salt) # Check for password in the file
29+
dictFile = open('dictionary.txt','r') # Open the dictionary file
30+
for word in dictFile.readlines(): # Scan through the file
31+
word = word.strip('\n')
32+
cryptWord = crypt.crypt(word, salt) # Check for password in the file
3433
if (cryptWord == cryptPass):
3534
print "[+] Found Password: "+word+"\n"
3635
return
3736
print "[-] Password Not Found.\n"
3837
return
3938

39+
4040
def main():
41-
passFile = open('passwords.txt') # Open the password file
42-
for line in passFile.readlines(): # Read through the file
41+
passFile = open('passwords.txt') # Open the password file
42+
for line in passFile.readlines(): # Read through the file
4343
if ":" in line:
44-
user=line.split(':')[0]
44+
user = line.split(':')[0]
4545
cryptPass = line.split(':')[1].strip(' ') # Prepare the user name etc
46-
print "[*] Cracking Password For: "+user
46+
print "[*] Cracking Password For: " + user
4747
testPass(cryptPass) # Call it to crack the users password
4848

4949
if __name__ == "__main__":

0 commit comments

Comments
 (0)