Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the principle of MySQL password authentication?

Shulou Source: shulou.com Published: 2022-05-31 19:20:45 09月30日 Update

This article introduces you what is the principle of MySQL password authentication, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. The server will randomly generate a random string to send to the client.

two。 After the client receives the random string, it encrypts the hash.

The first step is to hash the password to get the hash value hash _ stage1; eg.hash_stage1=sha1 ("password")

The second step, the second hash, to get hash_stage2; eg. Hash_stage2=sha1 (hash_stage1)

The third step is to hash the value obtained by the password secondary hash with random string to get hash_stage3; eg. Hash_stage3=sha1 ("random string", hash_stage2)

In the fourth step, XOR processing is ready to be sent to the server to get reply=xor (hash_stage1,hash_stage3).

Finally, the value of reply is sent to the server. Www.2cto.com

3. After receiving reply, the server also performs hash operation.

The first step is to hash the saved password hashpassword in hash form with random string to get server_hash_stage1=sha1 ("random string", "hashpassword")

The second step is to XOR the reply sent by the client and the hash value just obtained to get xor_value; eg. Xor_value=xor (reply,server_hash_stage1)

The third step is to hash the XOR value to get server_hash_stage2; eg. Server_hash_stage2=sha1 (server_hash_stage1)

The fourth step is to verify that the resulting hash value server _ hash_stage2 is compared with the saved password hashpassword. Eg. Server_hash_stage2==hashpassword, if it is equal, the verification passes.

What is the principle of MySQL password authentication is shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Password authentication server service client client principle content more help computing good interest buddy form article knowledge article preparation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Microsoft OPPO Reno Linux Shulou Technology