Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS实现密码加密(base64, md5, sha1) | 东隅已逝/桑榆非晚 #27

Open
h1z3y3 opened this issue Apr 23, 2021 · 0 comments
Open

JS实现密码加密(base64, md5, sha1) | 东隅已逝/桑榆非晚 #27

h1z3y3 opened this issue Apr 23, 2021 · 0 comments

Comments

@h1z3y3
Copy link
Owner

h1z3y3 commented Apr 23, 2021

https://h1z3y3.me/posts/javascript-md5-base64-sha1/

简介 在编写Web程序时,表单的提交若密码使用明文提交会十分不安全,因此在浏览器端也要对密码进行加密处理。但是若只是在浏览器端处理了,而服务器没有再一次加密,也是不妥当的,因为"中间人"只要获取了浏览器端加密的密码,不需要进行处理也能进行登录。所以我一般的做法是在前端加密一次,在服务器再加密一次。密码加盐(salt)的问题等我先研究下再写一下。而浏览器端加密一般我都用javascript进行加密后再提交。下面是用javascript编写的base64加密,md5加密和sha1加密。使用方法也极其简单,只要在页面内引入相应js文件即可。
……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant