The front RSA encryption

The front js introduced jsencrypt.js (official website to download resources available for free download (but not compatible ie browser, the following can result in ie9 js error SCRIPT1010, the specific reasons for self-google or Baidu). In this blog download resources compatible with IE version, there is little need partners can be downloaded).

The front js code:

passWord = document.getElementById var ( "j_password");
// RSA password encryption
var = new new JSEncrypt the encrypt ();
encrypt.setPublicKey ( "MIGfMA0GC4351345135134534"); // here RSA public key, here to write background generated public key , you can write dead
var passwordRSA = encrypt.encrypt (passWord.value); // encrypt the password

Distal background generated by the public key of a plaintext (password) is encrypted to a landing back after being encrypted, decrypted back into plain text through private key, thus encrypted is completed

 

Guess you like

Origin www.cnblogs.com/slfmeimei/p/11593639.html