feat:密码加密

This commit is contained in:
dzc committed 2026-08-09 15:11:30 +08:00
1 parent 0398148db7
commit 223a199ae8
2 files changed
+37 -11

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import * as CryptoJS from "crypto-js"
/**
*加密处理
*/
export function encryption(src: string, keyWord: string) {
const key = CryptoJS.enc.Utf8.parse(keyWord)
// 加密
var encrypted = CryptoJS.AES.encrypt(src, key, {
iv: key,
mode: CryptoJS.mode.CFB,
padding: CryptoJS.pad.NoPadding,
})
return encrypted.toString()
}