Front end encryption, MD5 encryption, base64 encrypting

Instructions:

First, download the plug

Download: https://www.npmjs.com/package/js-md5

Second, the introduction of js file

<script type="text/javascript" src="js/md5.min.js"></script>

Third, the code uses

// example. 1:
var md5_1 = MD5 ( 'with the single')
the console.log (md5_1); d23201238eb32a8e040cb1910d21de66 //
// Example 2:
var = md5_2 md5.hex ( 'with the single')
the console.log (md5_2); / / d23201238eb32a8e040cb1910d21de66
// example. 3:
var = md5_3 md5.array (with the single ')
the console.log (md5_3); // [210, 50,. 1, 35, 142, 179, 42 is, 142,. 4, 12 is, 177, 145, 13, 33, 222, 102]
// example. 4:
var = md5_4 md5.digest ( 'with the single')
the console.log (md5_4); // [210, 50,. 1, 35, 142, 179, 42 is , 142, 4, 12, 177, 145, 13, 33, 222, 102]
// example. 5:
var = md5_5 md5.arrayBuffer ( 'with the single')
the console.log (md5_5); arraybuffer //
// example 6 :
var = md5_6 md5.buffer ( 'with the single') function () {// with a single: www.gendan5.com
the console.log (md5_6);// buffer (not recommended)
// Example 7:
var md5_7 = md5.base64 ( 'with the single')
the console.log (md5_7); // == 0jIBI46zKo4EDLGRDSHeZg

Many people say there is no front-end encryption of use, it's like the world is absolutely no security system is the same reason, we do aim of these measures is not to have no flaws, but to eliminate the vast majority of low-level It cracks.

Is it because there is no security system is a duel reason to abandon any measure it?

Is home door locks can easily be thieves opened the lock is not installed yet?

Therefore, the front end of their daring to encrypt it, of course, if you can project the need to do so!

Talk about the benefits of front-end encryption:

1, in a non-secure HTTP connection, the original password to prevent eavesdropping (a lot of people use the same password as the password for other sites)

2, front-end encrypted, then encrypt the back-end is not yet? The answer is not allowed to re-encrypt the back-end and save the (front-end encryption rules are easily checked to see)

3, in general, not directly transmitted md5, but rather bring a valid token + [ciphertext encrypted password to ensure their safety]

4, to ensure that the backend logs do not record the password in clear text (to prevent some inner demons and privacy traffickers)

Guess you like

Origin blog.51cto.com/14513127/2439530