Discuz password encryption algorithm is actually two times MD5 encryption, first encrypted with plaintext, then randomly generate a salt, and then add a salt after the first cipher as plaintext and then once again MD5 encryption. The salt is saved in the Uc_members table and can be obtained by user name.
Like this:
MD5 (MD5 (Clear text) +salt)
The following is the implementation code for. NET:
|
copy code |
string getdiscuzpwstring (string sourcestr, string salt) { return Getmd5hash ( String. Concat (Getmd5hash (SOURCESTR), salt); } String Getmd5hash (String input) { MD5 md5hasher = MD5. Create (); byte[] data = Md5hasher.computehash (Encoding.Default.GetBytes (input)); StringBuilder sbuilder = new StringBuilder (); for (int i = 0; I < data. Length; i++) { sbuilder.append (Data[i]. ToString ("X2")); } return sbuilder.tostring (); } |
Summarize the method of password judgment
1: To install UC
2: Open the database Find uc_members This table, look for the last field "salt", copy the value inside
3:
$s =MD5 (MD5 ("password"). " The value of the Salt field ");
Echo $s;
4: Judging by If
5: Say it again! That's a random 6-digit number!
Discuz Password Generation