perf: update encrypted

This commit is contained in:
ibuler
2026-03-31 11:17:54 +08:00
parent 2c23349653
commit 040fcfe20c
3 changed files with 283 additions and 11 deletions

View File

@@ -441,12 +441,9 @@
</body>
{% include '_foot_js.html' %}
<script type="text/javascript" src="/static/js/plugins/jsencrypt/jsencrypt.3.3.2.min.js"></script>
<script type="text/javascript" src="/static/js/plugins/cryptojs/crypto-js.min.js"></script>
<script type="text/javascript" src="/static/js/crypto.bundle.js"></script>
<script type="text/javascript" src="/static/js/session-encrypt.js"></script>
<script type="text/javascript" src="/static/js/plugins/sm-crypto/sm2.min.js"></script>
<script type="text/javascript" src="/static/js/plugins/sm-crypto/sm4.min.js"></script>
<script type="text/javascript" src="/static/js/plugins/buffer/buffer.min.js"></script>
<script>
function doLogin(evt) {

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,14 @@
function fillKey(key, keyLength) {
let KeyLength = keyLength || 16
if (key.length > KeyLength) {
key = key.slice(0, KeyLength)
function fillKey(key) {
const keyLength = 16
if (key.length > keyLength) {
key = key.slice(0, keyLength)
}
const filledKey = Buffer.alloc(KeyLength)
const filledKey = Buffer.alloc(keyLength)
const keys = Buffer.from(key)
for (let i = 0; i < keys.length; i++) {
filledKey[i] = keys[i]
}
return filledKey.toString('hex')
return filledKey
}
function aesEncrypt(text, originKey) {