PASSWORD MySQL 5.6.21-1ubuntu14.04_amd64

來源:互聯網
上載者:User

標籤:io   ar   for   sp   on   c   cti   amp   r   

/*****************************************************************************  

The main idea is that no password are sent between client & server on  

connection and that no password are saved in mysql in a decodable form.

 

  On connection a random string is generated and sent to the client.  

The client generates a new string with a random generator inited with  

the hash values from the password and the sent string.  

This ‘check‘ string is sent to the server where it is compared with  

a string generated from the stored hash_value of the password and the  

random string.

 

  The password is saved (in user.password) by using the PASSWORD() function in  

mysql.

  This is .c file because it‘s used in libmysqlclient, which is entirely in C.  

(we need it to be portable to a variety of systems).   Example:    

update user set password=PASSWORD("hello") where user="test"  

This saves a hashed number as a string in the password field.

 

  The new authentication is performed in following manner:

 

    SERVER: public_seed=create_random_string()           

        send(public_seed)

    CLIENT:  recv(public_seed)   

        hash_stage1=sha1("password")           

        hash_stage2=sha1(hash_stage1)           

        reply=xor(hash_stage1, sha1(public_seed,hash_stage2)

              // this three steps are done in scramble()

               send(reply)

   SERVER:  recv(reply)

        hash_stage1=xor(reply, sha1(public_seed,hash_stage2))           

        candidate_hash2=sha1(hash_stage1)           

        check(candidate_hash2==hash_stage2)

             // this three steps are done in check_scramble()

*****************************************************************************/

PASSWORD MySQL 5.6.21-1ubuntu14.04_amd64

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.