什么是前端加密php
前端加密就是在客户端对用户要提交的内容进行加密,从而下降服务器端的压力。前端
为何要进行前端加密数据库
进行前端加密值后,要对密码进行破译和破解,则须要在客户端方面消耗更多的资源,延长了破解时间,从而得到了更高的安全性。后端
前端加密方式:浏览器
在固定字符串上截取随机长度和打乱顺序的字符串安全
function randomString(length) { var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split(''); if (! length) { length = Math.floor(Math.random() * chars.length); } var str = ''; for (var i = 0; i < length; i++) { str += chars[Math.floor(Math.random() * chars.length)]; } return str; }
RSA加密服务器
MD5实现的前端加密dom
MD5 is a secure hash algorithm. It takes a string as input, and produces a 128-bit number, the hash. The same string always produces the same hash, but given a hash, it is not generally possible to determine the original string. Secure hash algorithms are useful for protecting passwords and ensuring data integrity.post