问题:因为使用整数作为url查询参数,所以容易被遍历查询
解决:对整数键进行加密
方法:
# 加密
('加密%s' % id).encode('utf-8').hex()
# 简单的加解密
def decryt_hex(h):
s = bytes.fromhex(h).decode('utf-8')
return s[2:]
参考:
https://blog.csdn.net/zhengzaifeidelushang/article/details/123564687
问题:因为使用整数作为url查询参数,所以容易被遍历查询
解决:对整数键进行加密
方法:
# 加密
('加密%s' % id).encode('utf-8').hex()
# 简单的加解密
def decryt_hex(h):
s = bytes.fromhex(h).decode('utf-8')
return s[2:]
参考:
https://blog.csdn.net/zhengzaifeidelushang/article/details/123564687