Skip to content

Commit 178078d

Browse files
Fix the import error about fcrypt on WIndows
Fixed the import error when using Windows because of crypt module not existing there. Regarding the issue recently of the 'no file found dictionary.txt' or 'no file found dictionary.txt' You need to create both the file and put it into the same directory because the project's zip file does not include them. Any questions or problem, please comment. Closes geekcomputers#8
1 parent 3ab6f7e commit 178078d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

password_cracker.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,22 @@
88

99
# Description : Old school password cracker using python
1010

11-
import crypt # Import the module
11+
from sys import platform as _platform
12+
13+
# Check the current operating system to import the correct version of crypt
14+
if _platform == "linux" or _platform == "linux2":
15+
import crypt # Import the module
16+
elif _platform == "darwin":
17+
# Mac OS X
18+
import crypt
19+
elif _platform == "win32":
20+
# Windows
21+
try:
22+
import fcrypt # Try importing the fcrypt module
23+
except ImportError:
24+
print 'Please install fcrypt if you are on Windows'
25+
26+
1227

1328
def testPass(cryptPass): # Start the function
1429
salt = cryptPass[0:2]

0 commit comments

Comments
 (0)