I am too new to this. I used MD5 encryption in PC projects before, but now my mini program project uses enc-base64 and hmac-sha1 in CryptoJS. I have never used these two before. , so I am confused, why not continue to use MD5 in the mini program? So here I record some knowledge points to solve my doubts.
With the rise of the Internet, we pay more and more attention to the security of information, which makes various encryption such as user passwords more important in web development. During the interaction with the server, in order to ensure the security of data transmission and avoid packet capture and tampering by hackers.
Regarding Base64 encoding, I think reading an article can solve your doubts, so I won’t go into details here
? Base64 encoding principle
For example : User password, request parameters, file encryption
Such as: Interface parameter signature verification service
Payment data, CA digital certificate
Front-end friends may pay attention to the front-end js encryption, when we do the WEB login function, we usually submit it to the server through Form submission or Ajax for verification. In order to prevent packet capture, the login password must be encrypted (RSA) first and then submitted to the server for verification. Some big companies are using it, such as Taobao, JD.com, Sina, etc.
There are also many ready-made js libraries for front-end encryption, such as:
JS-RSA: Javascript library for performing OpenSSL RSA encryption, decryption and key generation, /travist/jsencrypt
MD5: One-way hash encryption md5 js library, /blueimp/JavaScript-MD5
crypto-js: Symmetric encryption AES js library, /brix/crypto-js
-CryptoJS (crypto.js) provides a variety of encryption algorithms for JavaScript.
The HMAC series is a message verification, used to verify whether a message has been tampered with - for example, email and hmac(email) are transmitted on the website, and hmac(email) can be used to know whether the email is forged by the user when receiving it.