一,hmac 验证客户端的合法性 hmac,检测客户端是否合法,不依赖登录认证 server import os,socket,hmac sk=socket.socket() sk.bind(('127.0.0.1',8090)) sk.listen() aa=b'hello' def bb(conn): msg=os.urandom(32) conn.send(msg) h=hmac.new(aa,msg) digest=h.digest() client_digest=conn.recv(1…