前端 happy 2018

xerfect · April 29, 2020 · 4 hits
function doDecrypt (pwd, onError) { console.log('in doDecrypt'); const txt = document.getElementById('enc_content').innerHTML; let plantext; try { const bytes = CryptoJS.AES.decrypt(txt, pwd); var plaintext = bytes.toString(CryptoJS.enc.Utf8); } catch(err) { if(onError) { onError(err); } return; } document.getElementById('enc_content').innerHTML = plaintext; document.getElementById('enc_content').style.display = 'block'; document.getElementById('enc_passwd').style.display = 'none'; if(typeof MathJax !== 'undefined') { MathJax.Hub.Queue( ['resetEquationNumbers', MathJax.InputJax.TeX], ['PreProcess', MathJax.Hub], ['Reprocess', MathJax.Hub] ); } } U2FsdGVkX1+gAHmvZwl3H9XPGFzeVI8TkBRJGvHfQj3H1Lm4OPP4XjW/agqk55Id9NCsDgqqyQaQ2svvTMuN8Z5Vg7geZ+FGfGA+c5fLY0LLThYD72Ry08tZ9bderNjhb0dXipFGlQV3Tu1zH/T2eTS2nPCOnN8OPyN8ebswRBFQbUQHXLOOECYM9eAWAdx6eO0orDvHaveq/VMKdrI8tuLLshnJRrff/rpZiJOGoD8SAiY9/5g50q3zqtD9sy0+I+uYQmF1Q6NbiJ1Ds9DX8N9neOjh2rCvuUcHmYTtauBX0boHx5GHD/oWh2IytFtlPqaJujRwXxd8pb9OTKQiscVe4c4x2xSKcTtJluO/qvDmFo8+NS/turF68IAu8siMnVB/n7G+l+vPy9BCPeXGkg3z2DgBK7wn/ncEwAuXr6cuz4wObwIcf7CI7OBwR9CkwA/GfAjxO+JR/6C/wBphs9+4eLnwCxUKDF29VfVrxDvc/yWjcJCHrOaV/Z/WAdHKcaPDquSp67b7I5wHCbUPmnH62Em6h/aEIejYx6DWNIQ= var onError = function(error) { document.getElementById("enc_error").innerHTML = "password error!" }; function decrypt() { var passwd = document.getElementById("enc_pwd_input").value; console.log(passwd); doDecrypt(passwd, onError); }

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.