MYSQL 在认证的过程中,客户端并不将MYSQL登录密码传输到服务端进行验证,在client连接到服务端后,服务端随机生成一个公钥,然后将公钥发给client端,client端利用公钥+登录密码生成一个新的随机串,然后将新的串发往服务端。服务端check字符串反解析,具体过程如下:
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()
阅读(4381) | 评论(0) | 转发(0) |