几种常用的前端加密
1、base64: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="base64.js"></script> <title>base64加密</title> </head> <body> <script> var rule = new Base64() var pwd = '123456' // 加密 var encryption = rule.encode('password:'+pwd) console.log(encryption) //cGFzc3dvcmQ6MTIzNDU2 // 解密 encryption = rule.decode(encryption); console.log(encryption) //password:123456 </script> </body> </html> 2、md5: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF