Js实现AES/RSA加密
1. function aesEncrypt(text, secKey) { var key = CryptoJS.enc.Utf8.parse(secKey); var iv = CryptoJS.enc.Utf8.parse( "0102030405060708" ); var srcs = CryptoJS.enc.Utf8.parse(text); var encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC }); return encrypted.toString() } function rsaEncrypt(text, pubKey, modulus) { setMaxDigits(131); var keys = new RSAKeyPair(pubKey, "" ,modulus); var encText = encryptedString(keys, text); return encText } 2. function b(a, b) { var c = CryptoJS.enc.Utf8.parse(b), d = CryptoJS.enc.Utf8.parse( "0102030405060708" ), e = CryptoJS.enc.Utf8