Skip to content

Commit bfa0d24

Browse files
committed
update readme.md & add __init__.py
1 parent 4d8b2fc commit bfa0d24

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.README.md.swp

12 KB
Binary file not shown.

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,48 @@ Crack the django password on the way. By default Django use pbkdf2 and sha256 me
66
## jake
77
* The ```jake.py``` is the password encryption implementation which is derived from django
88

9+
### Usage
10+
11+
For entertainment only :)
12+
13+
To decrypt the password in the Django framework, you need to get the value which is stored in the database table 'auth_user' column 'password'.
14+
15+
For example the encryped password is:
16+
pbkdf2_sha256$12000$Lz8oA7gW43mJ$N/DzMkLc/CX4oKHrU2bSPul3svNOmz8CYthM1JrR4Mo=
17+
{algorithm}${iteration times}${salt}${encryped password}
18+
19+
In this case, pbkdf2_sha256 is the encryption algorithm, and 12000 is the iteration times,
20+
21+
`Lz8oA7gW43mJ` is the salt,
22+
23+
`Lz8oA7gW43mJ$N/DzMkLc/CX4oKHrU2bSPul3svNOmz8CYthM1JrR4Mo=` is the base64 encoded password
24+
25+
**Note**:
26+
As of 2011, 10,000 iterations was the recommended default which
27+
took 100ms on a 2.2Ghz Core 2 Duo. This is probably the bare
28+
minimum for security given 1000 iterations was recommended in 2001.
29+
30+
This is also a standalone module derived from Django. If any other webframe work can use this module.
31+
32+
**When coding**:
33+
>>> from jake import give_back_hashed
34+
>>> from jake import get_base64_hashed
35+
>>> a = give_base64_hashed('the_password', 'the_salt', 'iteration_times', 'the_hashlib_digest_object(the algorithm)')
36+
>>> # this is the password which encrypted in the database table 'auth_user' column 'password'
37+
>>> print a
38+
N/DzMkLc/CX4oKHrU2bSPul3svNOmz8CYthM1JrR4Mo=
39+
>>> # or you can do this
40+
>>> import hashlib
41+
>>> b = give_base64_hashed('the_password', 'the_salt', 'iteration_times', hashlib.sha256)
42+
>>> print b
43+
N/DzMkLc/CX4oKHrU2bSPul3svNOmz8CYthM1JrR4Mo=
44+
>>> # To get the real sha256 hashed value
45+
>>> c = give_back_hashed(b)
46+
>>> print c
47+
'7\xf0\xf32B\xdc\xfc%\xf8\xa0\xa1\xebSf\xd2>\xe9w\xb2\xf3N\x9b?\x02b\xd8L\xd4\x9a\xd1\xe0\xca'
48+
>>> # you need other tools such as 'hashcat' or 'crack' to generate HASHes from
49+
>>> # a dictionay to compare them with this.
50+
951
Tools
1052
-----
1153
* ```hashcat. This can crack password from hashes based on word dictionaries. There are tones of algorithms built-in. Good dictionary is important. ``` <a href="http://www.hashcat.net/" target="_blank">hashcat offical link</a>
@@ -16,4 +58,4 @@ Explaination
1658
* The rainbow table might be very large. Normally it would be like more than hundreds Giga Bytes. So you could download or make one by own. But sometimes it would take too long to generate the rainbow table. For instance in this case Django uses PBKDF2 and algorithm sha256 to encrypt password iteration by iteration, which means it will take very long to generate a single password or a HASH. So brute-force cracking is somehow lousy. Or you have super computer, things would be better. Sometimes you don't.
1759
* So the summery here is: To crack the django's password, there are two ways. 1) brute-force cracking which takes very long and hard-working on computer expense. 2) middle attack which means user's password can be captured alive. This has something to do with the art of deception. Pratical and social engineering.
1860

19-
# Happy hacking
61+
#### Happy hacking

__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)