Skip to content

Commit 0c7b532

Browse files
committed
Merge pull request geekcomputers#25 from SirChristian123/patch-4
Fix the import error about fcrypt on WIndows
2 parents b83be21 + 178078d commit 0c7b532

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)