PASSWORD MySQL 5.6.21-1ubuntu14.04_amd64

Source: Internet
Author: User
Tags mysql in sha1

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

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

Connection and that no password is saved in MySQL in a decodable form.

On connection a random string was 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 was sent to the server where it was 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 was entirely in C.

(We need it to is 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 is 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 is done in check_scramble ()

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

PASSWORD MySQL 5.6.21-1ubuntu14.04_amd64

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.