|
关于加密的JS源码
var publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCw93f4CsVKbmfNNISrIMC5W9LK6o7dd/St3ehLBT0Ukct/1GvEgXRQMUM1Pjvj++/JzVE68dVzNV4GopdBRCmz3FQAib0fBYkmoHGghKKuJhTNwrqKMXXwi0gnEd1CuspQUK7YaNQHfae72dvuTBgnyA3H7mUdOajctCJGO9OawIDAQAB";
var txtpayapssword = $.trim($("#payPassword").val());
var encrypt = new JSEncrypt();
encrypt.setPublicKey(publicKey);
$("#payPassword").val(encrypt.encrypt(txtpayapssword));
加密后字符串实例
agV5foniJDkSrZx1uzpJJowghe3/amk1sgp1rCCRqO0LechyBHA8282uNwIReoDDmBC9bRrm62ltR5dYVF9/2t5W9Muk0/YENg4A76HjJaObmryT80pxqfDE8t0Rm9fj2wzqb44FyXjl0kAwBw3nFLl88beEF9/aGCZLukevn2k=
问题一:怎么把给定的公钥(publicKey)转换成XML格式?
问题二:公钥的长度比生成密文的长度长是为什么?
求大神帮助!
|
|