About the MD5

       MD5 often used as signature files appear , when we download a file, often see the file extension .MD5 page comes with a text or a line of characters, the character line is that the entire file as raw data by computing MD5 value after we downloaded the file, you can use the software to calculate a MD5 check the file information for the file to download in progress. Two comparative results can be downloaded to ensure the accuracy of the file.
Another common use is the site encryption of sensitive information , such as user name and password, and so on paid signature. With the popularity of https technology, now widely used website transmitted in the clear foreground to the background, MD5 encryption (using the offset) way to protect sensitive data protection and data security site.

MD5 decryption method
  when I store database, the field will be encrypted by md5 encryption method, when I read in the field how to properly read the original value ah
  ------ ------ Solutions --------------
  no way, MD5 is not reversible.

  You need to use reversible encryption algorithm.
  Solution -------------------- ------
  inserted when the md5 encryption table
  such as:
  $ SQL = "INSERT INTO the Register (names, pswd, repswd ) values ( '$ _POST [names]', MD5 ( '$ _POST [PSWD]'), MD5 ( '$ _POST [repswd]')) ";
  $ = QID the mysql_query ($ SQL);
  when read
  $ PSWD ? = empty ($ _ POST [ 'pswd']) '': MD5 ($ _ POST [ 'pswd']);
  ------ ---------------- solutions ---- If business requirements can be restored, then do not use MD5, please use reversible encryption algorithms, such as DES encryption.
  

  MD5 irreversible hash algorithm can be used to store user passwords, after storing unneeded you never need to know in plain text. Simply comparing the password entered by the user password again turn into MD5 code stored in comparison to that user password is correct .
  linux / unix operating system generally uses MD5 encrypted user password.

  ------ solutions --------------------
  MD5 current so-called crack collision method using just found the peer factor.
  For example: string1 the MD5 code for the MD1, and now we can do just to have found a string2, its MD5 code is MD1.
  The result: when a user login system uses MD5 encrypted password is 12345 originally, and now may also be used abcde landing.
  Think may restore it? If you can restore the information can also be used the day of the big 32-bit long string representation, and this does not become a super compression algorithms yet, the entire universe of information it can be expressed by 32 bits long. irreversible!


SQL statement, for example:

 1 elect   
 2 a.pre_apply_no
 3 ,a.book_date
 4 ,a.smg2_input_date
 5 ,t2.smg2_input_date
 6 ,b.id_card
 7 ,b.name
 8 ,md5(b.id_card) as id_card_md5
 9 ,md5(b.name) as name_md5
10 ,d.overdue_days
11 ,d.current_period
12 ,d.need_repay_day
13 ,get_json_object(e.searchresult,'$.newscore_level') as newscore_level
14 from 
15 (select pre_apply_no, loan_apply_no, book_date, smg2_input_date, smg5_credit_label_out
16 from houbank_analysis_sh.t_xloan_decision_data_allin 
17 where book_date >= '2019-03-01'
18 and smg5_credit_label_out in ('1','1.0')) a 
19 join houbank_analysis_sh.t_xloan_loan_lable b
20 on a.pre_apply_no = b.pre_apply_no
21 join houbank_cvt.xloan_cr_app_api_evaluate_input_cvt c
22 on a.pre_apply_no = c.objectid
23 join houbank_analysis_sh.t_repay_detail_dh d
24 on a.loan_apply_no = d.loan_apply_no
25 join houbank_cvt.xloan_cr_app_api_evaluate_result_cvt e 
26 on a.pre_apply_no = e.objectid
27 join  houbank_analysis_tmp_sh.t_xloan_decision_data_second t2
28 on a.pre_apply_no = t2.objectid
29 where get_json_object(c.searchresult, '$.lastpdl_loan_time') = ''
30 and d.need_repay_day < '2019-07-01'

Guess you like

Origin www.cnblogs.com/huangchenggener/p/10935846.html