什麼是前端加密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